feat(auth): migração final do UI frontend para Logto OIDC via GoTrue

This commit is contained in:
2026-08-17 19:14:49 +00:00
parent 0487439c2a
commit a5968c76f1
3 changed files with 60 additions and 346 deletions
+8 -6
View File
@@ -7,7 +7,7 @@ interface AuthContextType {
user: User | null;
session: Session | null;
loading: boolean;
signIn: (email: string, password: string) => Promise<{ error: unknown }>;
signIn: () => Promise<{ error: unknown }>;
signUp: (email: string, password: string) => Promise<{ error: unknown }>;
signOut: () => Promise<void>;
updatePassword: (password: string) => Promise<{ error: unknown }>;
@@ -334,15 +334,17 @@ export function AuthProvider({ children }: { children: ReactNode }) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [user?.id, authInitialized]);
const signIn = async (email: string, password: string) => {
const signIn = async () => {
try {
const { error } = await supabase.auth.signInWithPassword({
email,
password,
const { error } = await supabase.auth.signInWithOAuth({
provider: 'keycloak',
options: {
scopes: 'openid email profile',
}
});
return { error };
} catch (error) {
logger.error('Erro crítico no login:', error);
logger.error('Erro crítico no login SSO:', error);
return { error };
}
};