Merge pull request #51 from KeyZox71/change-oauth-redir

🔨」 fix: now redirecting on /
This commit is contained in:
yosyo
2025-10-14 14:01:13 +02:00
committed by GitHub
3 changed files with 4 additions and 6 deletions

View File

@ -12,6 +12,8 @@ GRAPH_PORT=3000
ELK_PORT=5601
GOOGLE_CALLBACK_URL=https://localhost:8443/api/v1
# the url to which the user will be redirected when it logs with google
CALLBACK_REDIR=http://localhost:3000
GOOGLE_CLIENT_SECRET=susAF
GOOGLE_CLIENT_ID=Really

View File

@ -45,9 +45,7 @@ export async function gLogCallback(request, reply, fastify) {
path: '/',
secure: env !== 'development',
sameSite: 'lax',
})
.code(200)
.send({ msg: "Login successful" });
}).redirect(process.env.CALLBACK_REDIR);
} catch (error) {
fastify.log.error(error);
reply.code(500).send({ error: 'Internal server error' });

View File

@ -57,9 +57,7 @@ export async function gRegisterCallback(request, reply, fastify) {
path: '/',
secure: env !== 'development',
sameSite: 'lax',
})
.code(200)
.send({ msg: "Register successful" });
}).redirect(process.env.CALLBACK_REDIR);
} catch (error) {
fastify.log.error(error);
reply.code(500).send({ error: 'Internal server error' });