Skip to content

Commit 6e04036

Browse files
committed
allow secondary claims to cascade tenancy data
1 parent ac7b213 commit 6e04036

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

data/model.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ func (model *BaseModel) GenID(ctx context.Context) {
4545
return
4646
}
4747

48+
if authClaim.GetTenantID() == "" {
49+
50+
secondaryClaims := security.SecondaryClaimsFromContext(ctx)
51+
if secondaryClaims != nil {
52+
authClaim = secondaryClaims
53+
}
54+
}
55+
4856
if model.AccessID == "" && authClaim.GetAccessID() != "" {
4957
model.AccessID = authClaim.GetAccessID()
5058
}

0 commit comments

Comments
 (0)