Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanAnsari authored Sep 22, 2024
1 parent 1fb7f58 commit e2c3216
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/auth/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export default function SignUp() {
throw new Error(result.error);
}

// After sign-up, check the session for user data
if (session) {
const userEmail = session.user?.email;
// Wait for session to update after sign-in
const sessionCheck = useSession(); // Re-check session
if (sessionCheck.data) {
const userEmail = sessionCheck.data.user?.email;

if (userEmail) {
const userData = await getUserData(userEmail);
if (userData) {
console.log(`User Plan: ${userData.plan}`);
console.log(`Max Requests Allowed: ${userData.requestCount}`);
console.log(`Requests Made: ${userData.requestCount}`);

toast.success(`Welcome! You are on the ${userData.plan} plan.`);
}
Expand Down

0 comments on commit e2c3216

Please sign in to comment.