fix(authn): quickly return when the password is absent in password-based authentication
This commit is contained in:
parent
4e4c93a758
commit
b0c5b447a4
|
@ -173,6 +173,8 @@ update(Config, _State) ->
|
|||
|
||||
authenticate(#{auth_method := _}, _) ->
|
||||
ignore;
|
||||
authenticate(#{password := undefined}, _) ->
|
||||
{error, bad_username_or_password};
|
||||
authenticate(
|
||||
#{password := Password} = Credential,
|
||||
#{
|
||||
|
|
|
@ -160,6 +160,8 @@ destroy(#{resource_id := ResourceId}) ->
|
|||
|
||||
authenticate(#{auth_method := _}, _) ->
|
||||
ignore;
|
||||
authenticate(#{password := undefined}, _) ->
|
||||
{error, bad_username_or_password};
|
||||
authenticate(
|
||||
#{password := Password} = Credential,
|
||||
#{
|
||||
|
|
|
@ -110,6 +110,8 @@ destroy(#{resource_id := ResourceId}) ->
|
|||
|
||||
authenticate(#{auth_method := _}, _) ->
|
||||
ignore;
|
||||
authenticate(#{password := undefined}, _) ->
|
||||
{error, bad_username_or_password};
|
||||
authenticate(
|
||||
#{password := Password} = Credential,
|
||||
#{
|
||||
|
|
|
@ -113,6 +113,8 @@ destroy(#{resource_id := ResourceId}) ->
|
|||
|
||||
authenticate(#{auth_method := _}, _) ->
|
||||
ignore;
|
||||
authenticate(#{password := undefined}, _) ->
|
||||
{error, bad_username_or_password};
|
||||
authenticate(
|
||||
#{password := Password} = Credential,
|
||||
#{
|
||||
|
|
|
@ -148,6 +148,8 @@ destroy(#{resource_id := ResourceId}) ->
|
|||
|
||||
authenticate(#{auth_method := _}, _) ->
|
||||
ignore;
|
||||
authenticate(#{password := undefined}, _) ->
|
||||
{error, bad_username_or_password};
|
||||
authenticate(
|
||||
#{password := Password} = Credential,
|
||||
#{
|
||||
|
|
|
@ -109,6 +109,8 @@ destroy(#{resource_id := ResourceId}) ->
|
|||
|
||||
authenticate(#{auth_method := _}, _) ->
|
||||
ignore;
|
||||
authenticate(#{password := undefined}, _) ->
|
||||
{error, bad_username_or_password};
|
||||
authenticate(
|
||||
#{password := Password} = Credential,
|
||||
#{
|
||||
|
|
Loading…
Reference in New Issue