feat: implement Stripe checkout integration and add related API endpoints
This commit is contained in:
@@ -76,8 +76,11 @@ export const useAuth = () => {
|
||||
const userCredential = await signInWithEmailAndPassword(auth, email, password)
|
||||
const idToken = await userCredential.user.getIdToken()
|
||||
|
||||
// Send token to backend
|
||||
await authenticateWithBackend(idToken)
|
||||
try {
|
||||
await authenticateWithBackend(idToken)
|
||||
} catch (backendErr) {
|
||||
console.warn('[useAuth] Backend authentication failed after email login:', backendErr)
|
||||
}
|
||||
|
||||
return userCredential.user
|
||||
} catch (err: any) {
|
||||
@@ -103,8 +106,11 @@ export const useAuth = () => {
|
||||
const userCredential = await signInWithPopup(auth, provider)
|
||||
const idToken = await userCredential.user.getIdToken()
|
||||
|
||||
// Send token to backend
|
||||
await authenticateWithBackend(idToken)
|
||||
try {
|
||||
await authenticateWithBackend(idToken)
|
||||
} catch (backendErr) {
|
||||
console.warn('[useAuth] Backend authentication failed after Google login:', backendErr)
|
||||
}
|
||||
|
||||
return userCredential.user
|
||||
} catch (err: any) {
|
||||
|
||||
Reference in New Issue
Block a user