Skip to content
Snippets Groups Projects
Commit fefce8fb authored by Yannis Barlas's avatar Yannis Barlas
Browse files

Merge branch 'redirect-fix' into 'main'

fix(*): add redirect uri to integration authenticated call

See merge request !65
parents 5432cd27 a0b25311
No related branches found
No related tags found
1 merge request!65fix(*): add redirect uri to integration authenticated call
......@@ -10,7 +10,7 @@ module.exports = {
integrations: {
test: {
clientId: 'ketida-editor',
redirectUrl: 'http://localhost:4000/provider-connection-popup/dummy',
redirectUri: 'http://localhost:4000/provider-connection-popup/dummy',
tokenUrl: 'http://example.com',
},
},
......
......@@ -24,7 +24,7 @@ module.exports = {
integrations: {
dummy: {
clientId: 'ketida-editor',
redirectUrl: 'http://localhost:4000/provider-connection-popup/dummy',
redirectUri: 'http://localhost:4000/provider-connection-popup/dummy',
tokenUrl:
'https://api.sandbox.lulu.com/auth/realms/glasstree/protocol/openid-connect/token',
},
......
......@@ -88,12 +88,14 @@ const createOAuthIdentity = async (userId, provider, sessionState, code) => {
const authorizeOAuth = async (provider, sessionState, code) => {
const tokenUrl = config.get(`integrations.${provider}.tokenUrl`)
const clientId = config.get(`integrations.${provider}.clientId`)
const redirectUri = config.get(`integrations.${provider}.redirectUri`)
const postData = {
code,
grant_type: 'authorization_code',
session_state: sessionState,
client_id: clientId,
redirect_uri: redirectUri,
}
const params = new URLSearchParams(postData)
......
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