Replies: 1 comment 3 replies
-
In my case when using credentials provider, I added the following script to the callback function
my |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Next-auth with Typescript. I'm using the next-auth-example project which means I'm using next-auth v5 Beta but I'll take examples for v4 happily as well.
This page talks about extending the
Session
type to get custom fields - https://next-auth.js.org/getting-started/typescriptI'm doing all this to try and get hold of the JWT that comes back from the provider, it seems that next-auth hides this pretty thoroughly. Ideally I want it on the client side but I'd take anything at this point as I've been trying for hours.
I tried making a
app/types/next-auth.d.ts
with:and adding to my
tsconfig.json
in the include key undercompilerOptions
:But this has had no effect, it compiles and runs but
.token
is always blankI feel like a critical paragraph's missing from the instructions, or they're out of date. Has anyone got any pointers?
I'm trying to build what must be a really standard use case, with one provider, Okta, and I just need to be able to get to the token so that I can put it in a header when calling my custom backend from the Next app.
All help very gratefully received
🙏🏻 🙏🏻 🙏🏻 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions