A simple, structured, flutter app to interact with the golang backend to log user, create user, change password with JWT security
golang-sample-api-jwt
Report Bug
·
Request Feature
Table of Contents
This flutter application does the following things :
- Display a an email/password screen if no jwt token stored.
- Automacly log the user if a accessToken or refreshToken is still valid
- Allow logged user to logout (destroy tokens)
- Allow user to create a new user
- Allow user to change password
- Allow user to access the JWT secured resource "ping"
To test the ping resource without identification, change the password with the checkbox checked for your account.
Login Page:
Home Page
Create user page
Change Password
- flutter
- a running application "golang-sample-api-jwt" on "localhost:8000"
- Login and store JWT token in flutter_secure
- Use the JWT via an interceptor in HTTP Header for Ping Secure
- Gracefully report API return error
- Use the onError interceptor
- Redirect to the login page if HTTPcode = 400 or 401 (empreinte changed for example)
- Do somes test
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Vincent Pélisset - @g4spine
Project Link: https://github.com/vinpel/flutter_sample_api_jwt
- DIO : https://pub.dev/packages/dio
- ndialog : https://pub.dev/packages/ndialog
- flutter_secure_storage : https://pub.dev/packages/flutter_secure_storage
- jwt_decoder : https://pub.dev/packages/jwt_decoder