Android: Small fixes to landing page and passthrough

This commit is contained in:
Pieter Vander Vennet 2025-01-21 21:06:50 +01:00
parent baa7379fbf
commit 77f4bc84aa
12 changed files with 55 additions and 31 deletions

View file

@ -1,9 +1,12 @@
<!DOCTYPE html>
<html>
<head><title>MapComplete Auth</title></head>
<head><title>MapComplete Auth</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</head>
<body>
Authorizing and redirecting, hang on...
<div id="token"></div>
<div id="token">Waiting for token</div>
<script type="module" src="./land.ts"></script>
</body>
</html>

View file

@ -12,6 +12,9 @@ const tokenSrc = new UIEventSource("")
new VariableUiElement(tokenSrc).AttachTo("token")
new OsmConnection().finishLogin(async (_, token: string) => {
console.log("Login finished, redirecting to passthrough; token is "+token)
await Utils.waitFor(10)
window.location.href = "https://app.mapcomplete.org/passthrough.html?oauth_token="+token
tokenSrc.set(token)
await Utils.waitFor(500)
window.location.href = "orgmapcomplete://passthrough.html?oauth_token="+token
await Utils.waitFor(500)
window.close()
})

View file

@ -2,6 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>MapComplete Login</title>
</head>
<body>