This project is a demonstration of how to implement a secure JWT (JSON Web Token) session management system using Flutterflow. The application includes a user registration system, login functionality, OTP (One-Time Password) verification, and secure session handling. You access the live application
here.
- User Registration
- User Login
- OTP Verification
- JWT Token Storage and Validation
- Session Management
- Secure API Calls
- Responsive Design for Mobile and Desktop
- Performance Optimizations
- Flutterflow: Visual application builder for Flutter.
- Flutter: UI toolkit for building natively compiled applications.
- JWT: JSON Web Tokens for secure authentication.
- Secure Storage: Securely store sensitive data on the device.
-
Clone the repository:
git clone https://github.com/Sne225/JWTSessionManagement.git cd JWTSessionManagement
-
Open the project in Flutterflow:
- Open Flutterflow and import the project.
-
Set up the API Endpoints:
- Add the provided API endpoints in the
API Calls
section of Flutterflow.(APIs ommited)
- Add the provided API endpoints in the
-
Configure Secure Storage:
- Ensure that the secure storage actions are correctly set up for storing and retrieving JWT tokens.
-
Register a New User:
- Navigate to the Registration page and fill in the required fields (username, email, password).
- Click the
Register
button to submit the information to the server. - A success message will be displayed upon successful registration.
-
Log In as an Existing User:
- Navigate to the Login page and enter your username and password.
- Click the
Login
button to submit the credentials to the server. - Upon successful login, you will be redirected to the OTP page.
-
OTP Verification:
- Enter the OTP sent to your registered email.
- Click the
Submit OTP
button to verify the OTP and receive the JWT token.
-
Session Management:
- The JWT token will be stored securely on the device.
- On app startup, the presence of a valid JWT token will be checked to maintain the user's session.
lib/
: Contains the Flutter project code.lib/pages/
: Contains the different pages of the application (Registration, Login, OTP, Home).lib/api/
: Contains the API call configurations.
- State management is handled using Flutterflow's built-in state management tools.
- A boolean state variable
isCovered
is used to manage the visibility of the cover element.