Skip to content

Commit c334ef7

Browse files
authored
Pass org id during authentication (#108)
* Pass org id during authentication * PR feedback
1 parent 0034f74 commit c334ef7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/auth.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,15 @@ const generateCodeChallenge = (codeVerifier) => {
114114
const getAuthUrl = (codeVerifier, state) => {
115115
const codeChallenge = generateCodeChallenge(codeVerifier)
116116
const nonce = storeStateObject(state)
117+
118+
const { dataset_name = '' } = state
119+
const agentid = dataset_name.split('/')[0]
120+
const agentidParam = agentid ? `&agentid=${agentid}` : ''
121+
117122
return `${process.env.REACT_APP_BASE_SITE}/oauth/authorize?client_id=${process.env.REACT_APP_OAUTH_CLIENT_ID}` +
118123
`&redirect_uri=${process.env.REACT_APP_OAUTH_REDIRECT_URI}` +
119124
`&response_type=code&code_challenge_method=S256&code_challenge=${codeChallenge}` +
125+
`${agentidParam}` +
120126
`&state=${encodeURIComponent(nonce)}`
121127
}
122128

0 commit comments

Comments
 (0)