chore: make dialyzer happy
This commit is contained in:
parent
1c78c6bf6d
commit
47badc3181
|
@ -39,7 +39,7 @@
|
||||||
{ok, NewState :: state()} | {error, Reason :: term()}.
|
{ok, NewState :: state()} | {error, Reason :: term()}.
|
||||||
-callback destroy(State :: state()) -> ok.
|
-callback destroy(State :: state()) -> ok.
|
||||||
-callback login(request(), State :: state()) ->
|
-callback login(request(), State :: state()) ->
|
||||||
{ok, dashboard_user_role(), Token :: binary()} | {error, Reason :: term()}.
|
{ok, dashboard_user_role(), Token :: binary()} | {redirect, fun()} | {error, Reason :: term()}.
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% Callback Interface
|
%% Callback Interface
|
||||||
|
|
|
@ -12,20 +12,22 @@
|
||||||
-behaviour(emqx_dashboard_sso).
|
-behaviour(emqx_dashboard_sso).
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
|
hocon_ref/0,
|
||||||
|
login_ref/0,
|
||||||
fields/1,
|
fields/1,
|
||||||
desc/1
|
desc/1
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
%% emqx_dashboard_sso callbacks
|
||||||
-export([
|
-export([
|
||||||
hocon_ref/0,
|
|
||||||
login_ref/0,
|
|
||||||
login/2,
|
|
||||||
create/1,
|
create/1,
|
||||||
update/2,
|
update/2,
|
||||||
destroy/1
|
destroy/1
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-export([callback/2]).
|
-export([login/2, callback/2]).
|
||||||
|
|
||||||
|
-dialyzer({nowarn_function, create/1}).
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% Hocon Schema
|
%% Hocon Schema
|
||||||
|
@ -156,7 +158,7 @@ callback(Req, #{sp := SP} = _State) ->
|
||||||
case esaml_cowboy:validate_assertion(SP, fun esaml_util:check_dupe_ets/2, Req) of
|
case esaml_cowboy:validate_assertion(SP, fun esaml_util:check_dupe_ets/2, Req) of
|
||||||
{ok, Assertion, _RelayState, _Req2} ->
|
{ok, Assertion, _RelayState, _Req2} ->
|
||||||
Subject = Assertion#esaml_assertion.subject,
|
Subject = Assertion#esaml_assertion.subject,
|
||||||
Username = Subject#esaml_subject.name,
|
Username = iolist_to_binary(Subject#esaml_subject.name),
|
||||||
ensure_user_exists(Username);
|
ensure_user_exists(Username);
|
||||||
{error, Reason0, _Req2} ->
|
{error, Reason0, _Req2} ->
|
||||||
Reason = [
|
Reason = [
|
||||||
|
|
Loading…
Reference in New Issue