fix(ui): avoid replaying social invitation callbacks

- Redirect invited social auth users after backend invitation acceptance
- Keep safe callback redirects for non-invitation social auth flows
This commit is contained in:
Adrián Jesús Peña Rodríguez
2026-07-01 14:31:51 +02:00
parent d995dc725f
commit e41281ddc9
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -46,7 +46,8 @@ export async function GET(req: Request) {
const { access, refresh } = data.data.attributes;
try {
const redirectPath = callbackPath;
// Invitation tokens are accepted during the social token exchange.
const redirectPath = invitationToken ? "/" : callbackPath;
const result = await signIn("social-oauth", {
accessToken: access,
refreshToken: refresh,
+2 -1
View File
@@ -46,7 +46,8 @@ export async function GET(req: Request) {
const { access, refresh } = data.data.attributes;
try {
const redirectPath = callbackPath;
// Invitation tokens are accepted during the social token exchange.
const redirectPath = invitationToken ? "/" : callbackPath;
const result = await signIn("social-oauth", {
accessToken: access,
refreshToken: refresh,