chore: add saml sso redirect login log

This commit is contained in:
JimMoen 2023-10-17 23:45:59 +08:00
parent c0ebaf9b6f
commit b2948666fb
No known key found for this signature in database
GPG Key ID: 87A520B4F76BA86D
2 changed files with 11 additions and 0 deletions

View File

@ -207,8 +207,15 @@ add_user_(Username, Password, Role, Desc) ->
description = Desc description = Desc
}, },
mnesia:write(Admin), mnesia:write(Admin),
?SLOG(info, #{msg => "dashboard_sso_user_added", username => Username, role => Role}),
flatten_username(#{username => Username, role => Role, description => Desc}); flatten_username(#{username => Username, role => Role, description => Desc});
[_] -> [_] ->
?SLOG(info, #{
msg => "dashboard_sso_user_add_failed",
reason => "username_already_exists",
username => Username,
role => Role
}),
mnesia:abort(<<"username_already_exist">>) mnesia:abort(<<"username_already_exist">>)
end. end.

View File

@ -95,6 +95,10 @@ sp_saml_callback(post, Req) ->
State = #{enable := true} -> State = #{enable := true} ->
case (provider(saml)):callback(Req, State) of case (provider(saml)):callback(Req, State) of
{redirect, Redirect} -> {redirect, Redirect} ->
?SLOG(info, #{
msg => "dashboard_saml_sso_login_successful",
redirect => "SAML login successful. Redirecting with LoginMeta."
}),
Redirect; Redirect;
{error, Reason} -> {error, Reason} ->
?SLOG(info, #{ ?SLOG(info, #{