UX: somewhat decent landing page for app.mapcomplete.org

This commit is contained in:
Pieter Vander Vennet 2025-01-22 02:22:53 +01:00
parent c167094b65
commit 7ebccfafd0
5 changed files with 39 additions and 15 deletions

View file

@ -6,15 +6,18 @@ import { VariableUiElement } from "../src/UI/Base/VariableUIElement"
console.log("Authorizing...")
const key = Constants.osmAuthConfig.url + "oauth2_state"
const st =window.localStorage.getItem(key )
console.log("Prev state is",key, st)
const st = window.localStorage.getItem(key)
console.log("Prev state is", key, st)
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)
console.log("Login finished, redirecting to passthrough; token is " + token)
tokenSrc.set(token)
await Utils.waitFor(500)
window.location.href = "orgmapcomplete://passthrough.html?oauth_token="+token
await Utils.waitFor(500)
window.location.href = "orgmapcomplete://passthrough.html?oauth_token=" + token
tokenSrc.set("Closing...")
await Utils.waitFor(50)
window.close()
})