Comments (6)
Hi @BracketJohn
I've managed to get it working. I am currently testing it. But everythings seems to be working. I do however, have a bunch of TS errors.
Here's my updated Gist.
https://gist.github.com/madsh93/b573b3d8f070e62eaebc5c53ae34e2cc
from nuxt-auth.
Hey @madsh93!
Thanks for the q + the gist, that's already super helpful. Hopefully we can get it to work and then we can add an example of it to the docs (:
I am having troubles with refresh tokens.
can you describe what the issue is with the refresh tokens in your setup?
from nuxt-auth.
Wow, great work, thanks! 💯
I think we can actually add two pieces of documentation based on this gist:
- example: how to use
nuxt-auth
+directus
(see #44 for another, similar PR) - example: how to add a token refresh hook (this would be new "callbacks" sub-section at the end of "Server-side usage" with a general intro to callbacks and then one sub-section of using the jwt callback to refresh sessions)
You wouldn't want to work on one of those by coincidence? :D
from nuxt-auth.
Closing this issue now - question was answered + the documentation that is going to merged soon will even contain the directus example as a recipe (see #90)
from nuxt-auth.
@madsh93 I keep getting a 401 Unauthorized
on every second refreshAccessToken()
the first one works great, but its not updating the refreshToken
in the JWT, so in the second call it's using the token that was provided during signin and initial creation of the JWT.
EDIT: temp fix from #200 works 🎉
from nuxt-auth.
Good to hear -> let's get #200 closed for everybody then 🎊
from nuxt-auth.
Related Issues (20)
- Unify `local` and `refresh` provider HOT 2
- `signoutData` might be `undefined` HOT 1
- Redirect route after signing in HOT 1
- not support with i18n module HOT 1
- Runtime types do not match documentation
- Explanation of the implications of working with custom middleware HOT 3
- Infinite loop after upgrading to Nuxt 3.12.4 (callbackUrl) HOT 8
- Default behaviour for setting empty string at refreshRequestTokenPointer HOT 1
- enableOnWindowFocus must be used only in authenticated condition
- OAUTH_CALLBACK_ERROR : expected 200 OK, got: 301 Moved Permanently with Custom provider HOT 1
- Unification and flexibility with `AUTH_ORIGIN`
- Adding headers to endpoint requests HOT 3
- BaseURL is used incorrectly HOT 2
- RefreshHandler failing to find refreshToken value
- return data from Signup() Local Composable HOT 2
- Token and Session null when called from cachedEventHandler HOT 1
- Polish `NUXT_AUTH_ORIGIN` logic
- enableOnWindowFocus is not working with local provider!
- Unable to use httpOnly attribute for authCookie HOT 1
- Add server-side access to tokens and session for the `local` and `refresh` providers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt-auth.