forked from MapComplete/MapComplete
UX: somewhat decent landing page for app.mapcomplete.org
This commit is contained in:
parent
c167094b65
commit
7ebccfafd0
5 changed files with 39 additions and 15 deletions
13
app/land.ts
13
app/land.ts
|
@ -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()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue