Fix(Auth): Flask Samesite attribute must be 'Lax' for OAuth login callback

This commit is contained in:
2025-01-31 14:35:18 +00:00
parent d45c882049
commit fea029d2be
4 changed files with 31 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ class Config:
# Auth0
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = 'Strict'
SESSION_COOKIE_SAMESITE = 'Lax' # 'Strict' # Strict is preferable for security, but Lax is required for OAuth functionality
REMEMBER_COOKIE_SECURE = True
# PERMANENT_SESSION_LIFETIME = 3600
WTF_CSRF_ENABLED = True

View File

@@ -24738,6 +24738,14 @@ VALUES
, 'tierneybailey13@gmail.com' -- email
, 1 -- is_super_user
, 1 -- active
),
(
'auth0|679cc2fe0d652a47af90d16b' -- id_user_auth0
, 'Demo' -- firstname
, '' -- surname
, 'bot@partsltd.co.uk' -- email
, 0 -- is_super_user
, 1 -- active
)
;

View File

@@ -900,6 +900,14 @@ VALUES
, 'tierneybailey13@gmail.com' -- email
, 1 -- is_super_user
, 1 -- active
),
(
'auth0|679cc2fe0d652a47af90d16b' -- id_user_auth0
, 'Demo' -- firstname
, '' -- surname
, 'bot@partsltd.co.uk' -- email
, 0 -- is_super_user
, 1 -- active
)
;

View File

@@ -0,0 +1,14 @@
USE partsltd_prod;
INSERT INTO Shop_User (
id_user_auth0
, firstname
, surname
, email
, is_super_user
, active
)
VALUES ( 'auth0|679cc2fe0d652a47af90d16b' , 'Demo' , '' , 'bot@partsltd.co.uk' , 0 , 1 );
INSERT INTO Shop_User_Role_Link ( id_user, id_role )
VALUES (4, 2);