feat(mobile): HU-AUT-001 a HU-AUT-006#12
Merged
Conversation
… session management
- add hybrid guard with cookie (admin) and bearer token (mobile) support - add @public decorator for open endpoints - reorganize database layer into infra/ with drizzle and redis - add KeycloakAdminService for realm and user management - enable uri versioning in main.ts - replace keyv/redis and cache-manager with ioredis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec: Autenticación Mobile (HU-AUT-001 a HU-AUT-006)
HU-AUT-001: Inicio de sesión
Vista:
app/(auth)/login.tsxQué implementa:
WebBrowser+expo-auth-session):ActivityIndicatora pantalla completa mientras!request || isStartingAuthcallback.tsxFlujo:
callback.tsxprocesa el redirect: extraecode, validastate, intercambia por tokens via POST altokenEndpoint. En exito llamaonSignedIn(session). En error muestra icono + mensaje enFitColors.redy redirige a login en 2.5 s.HU-AUT-002: Recuperación de contraseña
Pantalla:
app/(auth)/login.tsx(link) + Keycloak (flujo externo)Qué implementa:
keycloakAccountUrls.resetPasswordviaWebBrowser.openBrowserAsyncHU-AUT-004: Cierre de sesión seguro
Ubicaciones:
context/auth-context.tsx,app/(tabs)/profile.tsx,app/(settings)/index.tsxQué implementa:
signOut()ejecuta en orden:revokeKeycloakSession(refreshToken)-> POST back-channel a/protocol/openid-connect/logoutconclient_id+refresh_token(invalida la sesion en Keycloak; best-effort, no bloquea si falla)clearSession()del SecureStore/(auth)/loginEl boton de cerrar sesion esta en
profile.tsx(boton directo) y en(settings)/index.tsx(viaSettingsRow).HU-AUT-005: Autenticación en dos pasos (2FA)
Pantalla:
app/(settings)/index.tsxQué implementa:
keycloakAccountUrls.accountSecurityviaWebBrowser.openBrowserAsyncHU-AUT-006: Cambio de contraseña desde perfil
Pantalla:
app/(settings)/index.tsxQué implementa:
keycloakAccountUrls.accountSecurityviaWebBrowser.openBrowserAsyncExtra: Información Personal (HU-AUT-006 adyacente)
Pantalla:
app/(settings)/personal-info.tsxQué implementa: