Commit d931e21c authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Add scopes and respone types to authenticate api

parent b3d9c9c5
......@@ -81,7 +81,7 @@ const API = {
console.error("About to save config", JSON.stringify(config, undefined, 3))
dispatch(actions.serverConfig.save(config))
console.error("About to authentication")
console.error("About to authentication", JSON.stringify(config, undefined, 3))
const jsoconfig = {
providerID: "oauthPlay",
client_id: config.clientId,
......@@ -89,13 +89,25 @@ const API = {
authorization: config.authorization_endpoint
// scopes: { request: ["userinfo"]}
}
setTimeout(() => {
console.error("JSOCONFIG", JSON.stringify(jsoconfig, undefined, 2))
let opts = {}
if (config.response_type) {
opts.response_type = config.response_type
}
if (config.scopes) {
opts.scopes = {
request: config.scopes.split(' ')
}
}
appJSO = new jso(jsoconfig)
appJSO.getToken((token) => {
console.error("Got token, ayay", token)
dispatch(actions.tokens.save(token))
})
}, opts)
}, 1000)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment