diff --git a/src/utils/generateAuthUrl.js b/src/utils/generateAuthUrl.js index 1624bb2..88203a7 100644 --- a/src/utils/generateAuthUrl.js +++ b/src/utils/generateAuthUrl.js @@ -15,10 +15,13 @@ export function generateAuthUrl(options, type = 'login') { scope: config.scope, code_challenge: options.code_challenge, code_challenge_method: config.codeChallengeMethod, - state: options.state, - start_page: type === 'register' ? 'registration' : 'login' + state: options.state }; + if (type === 'register') { + searchParams.start_page = 'registration'; + } + if (org_code) { searchParams.org_code = org_code; }