unlikenesses / sanctum-flutter-backend Goto Github PK
View Code? Open in Web Editor NEWA Laravel API that uses the Laravel Sanctum package to handle authentication with a mobile app.
A Laravel API that uses the Laravel Sanctum package to handle authentication with a mobile app.
I hope you don't mind me asking a question here.
I am also working on creating a Flutter app with Laravel as the backend but there is one thing I don't fully understand. Why does Sanctum create multiple tokens for a single user whenever you log out and log back in?
Wouldn't it suffice to provide the user with a single token that is only attached to their specific account once they log in with their username/password? If they re-authenticate just provide them with the token which was generated initially using createToken
which is still in the database?
As I am testing this Flutter/Sanctum workflow out now and I am just logging in and out I am left with a database with has 10+ tokens generated to my user account. I understand you want to save the token on the local storage of the device in question but this does not help to combat a user switching or re-authenticating.
Thanks for reading, I love laravel-news.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.