From bcf788dad70976b74dee6a8f3c95bed5e01d7b75 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 25 Apr 2025 11:00:54 +0200 Subject: [PATCH] [Glitch] Fix sign-up e-mail confirmation page reloading on error or redirect Port 698e4fdef2ec37db229c668ca85f9ecfcabc9abe to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/entrypoints/sign_up.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/entrypoints/sign_up.ts b/app/javascript/flavours/glitch/entrypoints/sign_up.ts index 18e2931546..72f3b638c3 100644 --- a/app/javascript/flavours/glitch/entrypoints/sign_up.ts +++ b/app/javascript/flavours/glitch/entrypoints/sign_up.ts @@ -4,9 +4,12 @@ import axios from 'axios'; import ready from 'flavours/glitch/ready'; async function checkConfirmation() { - const response = await axios.get('/api/v1/emails/check_confirmation'); + const response = await axios.get('/api/v1/emails/check_confirmation', { + headers: { Accept: 'application/json' }, + withCredentials: true, + }); - if (response.data) { + if (response.status === 200 && response.data === true) { window.location.href = '/start'; } }