SkinFirts manages the full authentication lifecycle — from splash screen session rehydration through registration, login, profile editing, and logout — using a thinDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/BhushanBadhe39/SkinFirts/llms.txt
Use this file to discover all available pages before exploring further.
authService layer that coordinates between the MockAPI backend, React Native’s AsyncStorage, and a Redux UserSlice. All screens consume these service functions so no screen ever touches storage or Redux directly.
Authentication flow
When the app launches,SplashScreen runs immediately. It dispatches loadDoctors to pre-fetch the doctor roster and reads the persisted user from AsyncStorage. If a saved session is found, it hydrates the Redux store before the 3-second splash timer fires. The navigation destination is decided by the Redux isLoggedIn flag.
Register screen is the landing page for unauthenticated users. It presents two buttons — Log In and Sign Up — that navigate to their respective flows.
Registration flow
Fill in the registration form
The
The Sign Up button stays disabled until every field has a non-empty value (
SignUp screen collects five fields that are tracked in a single formData state object:| Field | Placeholder |
|---|---|
| Full Name | Your Full Name |
| Password | — |
| — | |
| Mobile Number | +91 XXXXXXXXXX |
| Date Of Birth | DD/MM/YYYY |
Object.values(formData).every(v => v.trim() !== '')).POST to /users and persist session
Inside
signUpUser, createUser(formData) POSTs to /users. The API merges pre-defined appointment arrays onto the payload before persisting. The resolved user object is then saved to AsyncStorage under the key @user_account_details and dispatched as setUser.Login flow
Enter credentials
Login1 collects an email address and a password. The Log In button is disabled until both fields are non-empty. A Forgot Password link navigates to the SetPassword screen, which is the forgot-password flow where the user can enter and confirm a new password.Fetch and match user
loginUser calls fetchUsers(), which GETs /users to retrieve the full user list. It then searches for a user whose email matches (case-insensitive, trimmed) and whose password matches exactly.Forgot password
TheSetPassword screen is reached via the Forgot Password link on the Login1 screen. It presents a Password field and a Confirm Password field, with a Create New Password button to submit the new credentials.
Logout
logoutUser(dispatch) removes the persisted session from AsyncStorage and dispatches clearUser(), which resets both state.user and state.isLoggedIn in the Redux store. The calling screen is responsible for resetting navigation to Register after the call resolves.
Editing user details
Profile updates go througheditUserDetails, which PATCHes the user record on the server by ID and then re-persists the updated object to both AsyncStorage and the Redux store.
/users/${id}:
Redux state shape — UserSlice
TheUserSlice holds two fields. Every piece of the app that needs to know whether a user is signed in reads from this slice via useSelector.
setUser(payload)
Sets
state.user to the dispatched payload and flips state.isLoggedIn to true. Called after a successful sign-up, login, or profile edit.clearUser()
Resets
state.user to null and state.isLoggedIn to false. Called by logoutUser.AsyncStorage key
All session persistence uses a single key:Passwords are stored and compared as plain strings on MockAPI. This is intentional for the development environment only. Before shipping to production, replace the credential-matching logic in
loginUser with a proper hashed-password or token-based authentication scheme.