File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ export async function createAuthContext(
170170 socialProviders : providers ,
171171 options,
172172 oauthConfig : {
173- storeStateStrategy : options . account ?. storeStateStrategy || "database" ,
173+ storeStateStrategy :
174+ options . account ?. storeStateStrategy ||
175+ ( options . database ? "database" : "cookie" ) ,
174176 skipStateCookieCheck : ! ! options . account ?. skipStateCookieCheck ,
175177 } ,
176178 tables,
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ export async function generateState(
2727
2828 const codeVerifier = generateRandomString ( 128 ) ;
2929 const state = generateRandomString ( 32 ) ;
30- const storeStateStrategy =
31- c . context . oauthConfig ?. storeStateStrategy || "cookie" ;
30+ const storeStateStrategy = c . context . oauthConfig . storeStateStrategy ;
3231
3332 const stateData = {
3433 ...( additionalData ? additionalData : { } ) ,
@@ -99,8 +98,7 @@ export async function generateState(
9998
10099export async function parseState ( c : GenericEndpointContext ) {
101100 const state = c . query . state || c . body . state ;
102- const storeStateStrategy =
103- c . context . oauthConfig . storeStateStrategy || "cookie" ;
101+ const storeStateStrategy = c . context . oauthConfig . storeStateStrategy ;
104102
105103 const stateDataSchema = z . looseObject ( {
106104 callbackURL : z . string ( ) ,
You can’t perform that action at this time.
0 commit comments