Skip to content

An example of token based React Native authentication with redux and react-navigation

Notifications You must be signed in to change notification settings

raduungurean/react-native-redux-auth-login-logout-example

Repository files navigation

React Native Redux Auth (Login, Logout) Example

An example of token based React Native authentication.

Library Version
react 16.9.0
redux 4.0.5
react-redux 7.2.0
@react-navigation/native 5.5.1
@react-navigation/stack 5.4.2
redux-thunk 2.3.0

Installation

yarn (or npm install)

How to run

yarn android (or npm run android) yarn ios (or npm run ios) yarn web (or npm run web)

APIs

Endpoint (Request Method: POST) Response
${apiUrl}/login Error Response: {"success":false, "message":"..."}
${apiUrl}/login Success Response: Status Code: 200 Ok. {"success": true, "token": "...", "user": {"id": "...", "first_name": "...", ...}}
${apiUrl}/logout Error Response: {"success":false, "message": "..."
${apiUrl}/logout Success Response: Status Code: 200 Ok. {"success":true,"message":"User logged out successfully"}

About

An example of token based React Native authentication with redux and react-navigation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages