mobile: login - bouton Google OAuth + show/hide password + message erreur Google
- login.tsx: bouton 'Continuer avec Google' (expo-web-browser + deep link memento://auth) - login.tsx: bouton oeil pour afficher/masquer mot de passe - login.tsx: message d'erreur contextuel si compte Google (pas de mot de passe en DB) - store.ts: loginWithToken() pour recevoir le token après OAuth Google - google-start/route.ts: lance le flux NextAuth Google avec redirect callback - google-callback/route.ts: reçoit la session, génère token mobile, redirige vers memento://auth Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
9
memento-note/app/api/mobile/auth/google-start/route.ts
Normal file
9
memento-note/app/api/mobile/auth/google-start/route.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
|
||||
// Lance le flux Google OAuth et redirige vers le callback mobile
|
||||
export async function GET(req: NextRequest) {
|
||||
const baseUrl = process.env.NEXTAUTH_URL || 'https://memento-note.com'
|
||||
const callbackUrl = `${baseUrl}/api/mobile/auth/google-callback`
|
||||
const signinUrl = `${baseUrl}/api/auth/signin/google?callbackUrl=${encodeURIComponent(callbackUrl)}`
|
||||
return NextResponse.redirect(signinUrl)
|
||||
}
|
||||
Reference in New Issue
Block a user