Add default value to login

This commit is contained in:
Kai Vogelgesang 2020-04-17 03:35:55 +02:00
parent 1d55095691
commit 92065a7fa7
2 changed files with 3 additions and 3 deletions

View File

@ -17,9 +17,9 @@ this is the base site
<script>
document.getElementById("btn_register").onclick = function (e) {
let username = document.getElementById("username").value;
let username = document.getElementById("username");
window.location.replace(`register/${encodeURIComponent(username)}`)
window.location.replace(`register/${encodeURIComponent(username.value || username.placeholder)}`)
};
</script>
</body>

View File

@ -96,7 +96,7 @@ async def handler(request):
return aiohttp.web.FileResponse('index.html')
@routes.get('/register/{username}')
@routes.get('/register/{username:.+}')
async def handler(request):
model = request.app['model']
username = request.match_info.get('username', 'Joe')