Access Token and Refresh Tokens | Build Starter Kit for Single Page Apps #3

Опубликовано: 03 Март 2026
на канале: Creative Bracket • Dart and Flutter Tutorials
4,151
95

We will implement a refresh token along with our access token to be used when issuing our a new access token after the current one expires. We will create a Token service that will generate our token pairs and also persist our refresh tokens in a Redis datastore. We will bootstrap our Redis server by creating a docker compose file, which we will communicate with using the Redis client package. We will also use redis-commander as our UI for viewing the data in our store.

=== Contents of this video ===

00:00 Intro
00:28 Add Redis and Uuid packages
01:04 Implement TokenService class
02:54 Bootstrap Redis server with Docker Compose
03:36 Connect to our Redis server
03:50 Implement createTokenPair and addRefreshToken methods
09:48 Install and use Redis Commander UI
11:04 Implement getRefreshToken and deleteRefreshToken methods
13:03 Create refresh token endpoint
16:56 Refactor solution to use .env variables
19:50 Outro


Please leave us your feedback in the comments, and let us know what you would like us to demonstrate next! You can reach out in the comments below or on Twitter using #FullstackDart #Dartlang #DartStarterKit #Flutter

Like, Subscribe and Hit the Bell 🔔 if you enjoyed this video 😍

Get the source code → https://github.com/graphicbeacon/dart...
Get started with Dart course → https://bit.ly/getstartedwithdart

Dart docs → https://dart.dev
Subscribe to the channel → http://bit.ly/2P2N1jC

Read More Dart Tutorials → https://creativebracket.com
Buy me a coffee → https://ko-fi.com/creativebracket

LET'S CONNECT
---
Twitter →   / creativ_bracket  
Support the channel →   / creativebracket