MapComplete/src/land.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
421 B
TypeScript
Raw Normal View History

2023-09-01 21:36:39 +02:00
import {OsmConnection} from "./Logic/Osm/OsmConnection";
console.log("Authorizing...");
new OsmConnection().finishLogin(previousURL => {
const fallback = window.location.protocol+"//"+window.location.host+"/index.html"
previousURL ??= fallback
if(previousURL.indexOf("/land") > 0){
previousURL = fallback
}
console.log("Redirecting to", previousURL)
window.location.href = previousURL
})