diff --git a/src/front/Components/Layouts/Login/StepEmail/index.tsx b/src/front/Components/Layouts/Login/StepEmail/index.tsx index 649f0373..5a534224 100644 --- a/src/front/Components/Layouts/Login/StepEmail/index.tsx +++ b/src/front/Components/Layouts/Login/StepEmail/index.tsx @@ -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);