Skip to content

Commit e0f1992

Browse files
committed
docs: add documentation
1 parent 1c905fa commit e0f1992

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ const refreshToken = await User.refreshTokens.create(user)
204204
// if you use the refresh token
205205
router.post('jwt/refresh', async ({ auth }) => {
206206
// this will authenticate the user using the refresh token
207-
// it will delete the old refresh token and generate a new one
208-
const user = await auth.use('jwt').authenticateWithRefreshToken()
207+
// it will delete the old refresh token and generate a new one with the same abilities
208+
// You could pass a name for the new token as well
209+
const user = await auth.use('jwt').authenticateWithRefreshToken('optional_name')
209210
const newRefreshToken = user.currentToken
210211
const newToken = await auth.use('jwt').generate(user)
211212

0 commit comments

Comments
 (0)