Skip to content

Commit e562db2

Browse files
authored
Merge pull request #950 from trycompai/claudio/stripe
[dev] [claudfuen] claudio/stripe
2 parents f81c32d + c85c290 commit e562db2

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

apps/app/src/app/api/auth/invitation/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export async function GET(request: Request) {
1919
return redirect(`/auth?inviteCode=${encodeURIComponent(inviteCode)}`);
2020
}
2121

22-
// If logged in, redirect to the invitation page
22+
// If logged in, redirect to the invitation page, which will handle validation
2323
return redirect(`/invite/${inviteCode}`);
2424
}

apps/app/src/components/github-sign-in.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ export function GithubSignIn({ inviteCode }: { inviteCode?: string }) {
1313
const handleSignIn = async () => {
1414
setLoading(true);
1515

16-
const redirectTo = inviteCode ? `/api/auth/invitation?code=${inviteCode}` : '/';
16+
const redirectTo = inviteCode ? `/invite/${inviteCode}` : '/';
1717

1818
await authClient.signIn.social({
1919
provider: 'github',
20+
callbackURL: redirectTo,
2021
});
2122
};
2223

apps/app/src/components/google-sign-in.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ export function GoogleSignIn({ inviteCode }: { inviteCode?: string }) {
1515
let redirectTo = '/';
1616

1717
if (inviteCode) {
18-
redirectTo = `/api/auth/invitation?code=${inviteCode}`;
18+
redirectTo = `/invite/${inviteCode}`;
1919
}
2020

2121
await authClient.signIn.social({
2222
provider: 'google',
23+
callbackURL: redirectTo,
2324
});
2425
};
2526

apps/framework-editor/app/(pages)/auth/google-sign-in.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ export function GoogleSignIn({ inviteCode }: { inviteCode?: string }) {
1515
let redirectTo = '/';
1616

1717
if (inviteCode) {
18-
redirectTo = `/api/auth/invitation?code=${inviteCode}`;
18+
redirectTo = `/invite/${inviteCode}`;
1919
}
2020

2121
await authClient.signIn.social({
2222
provider: 'google',
23+
callbackURL: redirectTo,
2324
});
2425
};
2526

0 commit comments

Comments
 (0)