AMS uses a fully local authentication system — there is no remote auth server. All user accounts are stored in device memory via React Native’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jay-byte389/AMS/llms.txt
Use this file to discover all available pages before exploring further.
AsyncStorage, and sessions are persisted using the @logged_in_user key. Authentication state is managed globally through Redux Toolkit, exposing loading indicators and error messages to every screen.
Auth Flow
Register Screen
The app launches to the
RegisterScreen (route name Register), which presents two buttons: Log In and Sign Up. This is the entry point of the AuthNavigator.Sign Up
Tapping Sign Up navigates to
SignUpScreen (route SignUp). The user fills in five fields — Full Name, Password, Email, Mobile Number, and Date of Birth — and submits. On success the signupUser thunk saves the account to @registered_users in AsyncStorage and also writes a session to @logged_in_user, then the screen navigates to Login.Set Password (Forgot Password)
From
LoginScreen the user can tap Forgot Password to reach the SetPassword screen (route SetPassword). They enter a new password and confirm it; updatePassword updates the stored record. On success the app navigates back to Login.Login
LoginScreen (route Login) accepts an email or mobile number plus a password. The validateUser storage function looks up the record in @registered_users, compares credentials, and — if successful — calls saveLoggedInUser to write the session object to @logged_in_user. The user is then navigated to BottomTabs.Registration
TheSignUpScreen collects the following fields and dispatches signupUser:
signupUser calls two storage functions in sequence:
Login
LoginScreen validates the user directly (without Redux) by calling validateUser and saveLoggedInUser from src/services/storage.js:
validateUser function in src/services/storage.js looks up the user by email or mobile and compares the plain-text password:
loginUser thunk wraps the same logic for Redux-driven flows:
Session Persistence
On every app launch,checkAuthSession restores the session from AsyncStorage:
getLoggedInUser storage helper reads the @logged_in_user key and returns the parsed user object or null.
Logout
Logout dispatches thelogoutUser thunk, which removes the @logged_in_user key from AsyncStorage and resets Redux state to isAuthenticated: false:
ProfileMenuList calls navigation.replace('Auth', { screen: 'Login' }) to return the user to the auth stack.
Redux Auth State
TheauthSlice (src/redux/slices/authSlice.js) exposes the following state shape:
clearAuthError action to reset error state without triggering a thunk:
AsyncStorage Keys Reference
| Key | Purpose |
|---|---|
@registered_users | JSON array of all registered user objects |
@logged_in_user | JSON object of the currently active session |
Passwords are stored as plain text in AsyncStorage. This is intentional for the current development build — do not ship this approach to production. Before releasing the app, hash passwords with a library such as
bcrypt-react-native or delegate authentication to a secure backend service.