feat: implement Stripe checkout integration and add related API endpoints

This commit is contained in:
Frank John Begornia
2025-11-08 01:47:14 +08:00
parent 86f9cf803a
commit 0ff41822af
12 changed files with 443 additions and 97 deletions

View File

@@ -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) {