Android: get login working

This commit is contained in:
Pieter Vander Vennet 2024-12-31 19:55:08 +01:00
parent 00c233a2eb
commit 88c76498b6
16 changed files with 199 additions and 171 deletions

View file

@ -51,13 +51,11 @@ export class AndroidPolyfill {
this.backfillGeolocation(this.databridgePlugin)
}
public static async requestLoginCodes(osmConnection: OsmConnection) {
public static async requestLoginCodes() {
const result = await DatabridgePluginSingleton.request<{oauth_token: string}>({ key: "request:login" })
const token: string = result.value.oauth_token
console.log("AndroidPolyfill: received code and state; trying to pass them to the oauth lib",token)
const auth = osmConnection.auth.bootstrapToken(token, (err, result) => {
console.log("AndroidPolyFill: bootstraptoken returned", JSON.stringify({err, result}))
})
console.log("AndroidPolyfill: received oauth_token; trying to pass them to the oauth lib",token)
return token
}
}