refactor(auth): unify OIDC provisioning under shared default_tenant_mode policy
Drop the standalone OIDC_AUTH_DEFAULT_TENANT_MODE / oidc_auth.default_tenant_mode knob so OIDC auto-provisioning and local password registration share the single auth.default_tenant_mode policy (resolved by the callback handler). Repair tenantless sessions by falling back to the first active membership on the login happy path and stale-preference paths, allow tenantless PUT /auth/me/preferences, clear the tenant snapshot on /auth/me responses without a tenant, and default the frontend canCreateTenant capability to fail-closed until /auth/me confirms it.
This commit is contained in:
@@ -353,7 +353,7 @@ func (h *AuthHandler) OIDCRedirectCallback(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := h.userService.LoginWithOIDC(ctx, code, strings.TrimSpace(decodedState.RedirectURI))
|
||||
resp, err := h.userService.LoginWithOIDC(ctx, code, strings.TrimSpace(decodedState.RedirectURI), h.resolveDefaultTenantMode(ctx))
|
||||
if err != nil {
|
||||
logger.Errorf(ctx, "Failed to complete OIDC login via redirect callback: %v", err)
|
||||
c.Redirect(http.StatusFound, frontendRedirectURI+"#oidc_error="+urlQueryEscape("login_failed")+"&oidc_error_description="+urlQueryEscape(err.Error()))
|
||||
|
||||
Reference in New Issue
Block a user