mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 17:47:54 +08:00
fix(users): fallback to fresh lineage context if cached role_id no longer matches (#8593)
This commit is contained in:
@ -158,7 +158,11 @@ impl JWTFlow {
|
|||||||
UserRoleVersion::V2,
|
UserRoleVersion::V2,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.is_ok();
|
.inspect_err(|e| {
|
||||||
|
logger::error!("Failed to validate V2 role: {e:?}");
|
||||||
|
})
|
||||||
|
.map(|role| role.role_id == ctx.role_id)
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
if user_role_match_v2 {
|
if user_role_match_v2 {
|
||||||
ctx
|
ctx
|
||||||
@ -174,7 +178,11 @@ impl JWTFlow {
|
|||||||
UserRoleVersion::V1,
|
UserRoleVersion::V1,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.is_ok();
|
.inspect_err(|e| {
|
||||||
|
logger::error!("Failed to validate V1 role: {e:?}");
|
||||||
|
})
|
||||||
|
.map(|role| role.role_id == ctx.role_id)
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
if user_role_match_v1 {
|
if user_role_match_v1 {
|
||||||
ctx
|
ctx
|
||||||
|
|||||||
Reference in New Issue
Block a user