File tree 3 files changed +11
-2
lines changed 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " next-auth" ,
3
- "version" : " 3.0.0-beta.25 " ,
3
+ "version" : " 3.0.0-beta.26 " ,
4
4
"description" : " Authentication for Next.js" ,
5
5
"homepage" : " https://next-auth.js.org" ,
6
6
"repository" : " https://github.com/iaincollins/next-auth.git" ,
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ const getToken = async (args) => {
97
97
// Use secure prefix for cookie name, unless URL is NEXTAUTH_URL is http://
98
98
// or not set (e.g. development or test instance) case use unprefixed name
99
99
secureCookie = ! ( ! process . env . NEXTAUTH_URL || process . env . NEXTAUTH_URL . startsWith ( 'http://' ) ) ,
100
- cookieName = ( secureCookie ) ? '__Secure-next-auth.session-token' : 'next-auth.session-token'
100
+ cookieName = ( secureCookie ) ? '__Secure-next-auth.session-token' : 'next-auth.session-token' ,
101
+ raw = false
101
102
} = args
102
103
if ( ! req ) throw new Error ( 'Must pass `req` to JWT getToken()' )
103
104
@@ -112,6 +113,10 @@ const getToken = async (args) => {
112
113
token = decodeURIComponent ( urlEncodedToken )
113
114
}
114
115
116
+ if ( raw ) {
117
+ return token
118
+ }
119
+
115
120
try {
116
121
return await decode ( { token, ...args } )
117
122
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -178,6 +178,10 @@ It also supports the following options:
178
178
179
179
The ` secureCookie ` option is ignored if ` cookieName ` is explcitly specified.
180
180
181
+ * ` raw ` - (boolean) Get raw token (not decoded)
182
+
183
+ If set to ` true ` returns the raw token without decrypting or verifying it.
184
+
181
185
::: note
182
186
The JWT is stored in the Session Token cookie, the same cookie used for tokens with database sessions.
183
187
:::
You can’t perform that action at this time.
0 commit comments