chore(idnot): log authorizeUrl and state to ensure state present
All checks were successful
build-and-push-ext / build_push (push) Successful in 57s

This commit is contained in:
Debian Dev4 2025-09-23 06:58:18 +00:00
parent 6e0e4ecbfe
commit 87bb57dae0

View File

@ -66,9 +66,16 @@ export default function StepEmail(props: IProps) {
return;
}
const { state } = await resp.json();
if (!state) {
console.warn('[IDNOT] Backend returned empty state');
setIsErrorModalOpen(4);
return;
}
const fixedRedirect = variables.IDNOT_REDIRECT_URI_FIXED || 'http://local.4nkweb.com:3000/authorized-client';
const authorizeBase = `${variables.IDNOT_BASE_URL}${variables.IDNOT_AUTHORIZE_ENDPOINT}`;
const authorizeUrl = `${authorizeBase}?client_id=${encodeURIComponent(variables.IDNOT_CLIENT_ID)}&redirect_uri=${encodeURIComponent(fixedRedirect)}&scope=openid,profile&response_type=code&state=${encodeURIComponent(state)}`;
console.log('[IDNOT] authorizeUrl', authorizeUrl);
console.log('[IDNOT] state', state);
router.push(authorizeUrl);
} catch (e) {
console.error('[IDNOT] Unexpected error while starting login', e);