feat: add OAuth redirect handling and update Google OAuth integration

This commit is contained in:
2026-03-19 21:19:49 -03:00
parent 34cbd4a861
commit 39f024f98d
5 changed files with 31 additions and 23 deletions
-4
View File
@@ -7,7 +7,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import { Ionicons } from '@expo/vector-icons';
import * as Google from 'expo-auth-session/providers/google';
import * as WebBrowser from 'expo-web-browser';
import { Screen } from '@presentation/components/layout/Screen';
import { Input } from '@presentation/components/ui/Input';
import { Button } from '@presentation/components/ui/Button';
@@ -16,9 +15,6 @@ import { loginUseCase, googleLoginUseCase } from '@infrastructure/container';
import { useAuthStore } from '@store/authStore';
import { CatIcon } from '@presentation/components/icons/CatIcon';
// Necessário para fechar o browser após redirect OAuth no Android/iOS
WebBrowser.maybeCompleteAuthSession();
const schema = z.object({
email: z.string().email('E-mail inválido'),
password: z.string().min(1, 'Senha obrigatória'),
+11
View File
@@ -0,0 +1,11 @@
import * as WebBrowser from 'expo-web-browser';
// Esta tela é o destino do redirect OAuth (meowspool://oauthredirect?code=...).
// maybeCompleteAuthSession() detecta os parâmetros da URL, sinaliza o
// expo-auth-session para fechar o browser e entregar o resultado ao hook
// useAuthRequest em login.tsx.
WebBrowser.maybeCompleteAuthSession();
export default function OAuthRedirect(): null {
return null;
}