Use error from OnSamlLogin (#30745)
Этот коммит содержится в:
@@ -182,10 +182,16 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
AcceptLanguage: c.AppContext.AcceptLanguage(),
|
||||
UserAgent: c.AppContext.UserAgent(),
|
||||
}
|
||||
|
||||
var hookErr error
|
||||
c.App.Channels().RunMultiHook(func(hooks plugin.Hooks, manifest *model.Manifest) bool {
|
||||
err := hooks.OnSAMLLogin(pluginContext, user, assertion)
|
||||
return err == nil
|
||||
hookErr = hooks.OnSAMLLogin(pluginContext, user, assertion)
|
||||
return hookErr == nil
|
||||
}, plugin.OnSAMLLoginID)
|
||||
if hookErr != nil {
|
||||
handleError(model.NewAppError("completeSaml", "api.user.authorize_oauth_user.saml_hook_error.app_error", nil, "", http.StatusInternalServerError).Wrap(hookErr))
|
||||
return
|
||||
}
|
||||
|
||||
auditRec.AddMeta("obtained_user_id", user.Id)
|
||||
c.LogAuditWithUserId(user.Id, "obtained user")
|
||||
|
||||
Ссылка в новой задаче
Block a user