Hyey Zach, thanks for getting back to me!
The failure/3
gets called actually.
def failure(conn, _activity, _reason) do
conn
|> put_status(401)
|> render("failure.html")
end
this is the output from inspecting the conn
%AshAuthentication.Errors.AuthenticationFailed{
field: nil,
strategy: %AshAuthentication.Strategy.Password{
confirmation_required?: true,
hash_provider: AshAuthentication.BcryptProvider,
hashed_password_field: :hashed_password,
identity_field: :email,
name: :password,
password_confirmation_field: :password_confirmation,
password_field: :password,
provider: :password,
register_action_accept: [],
register_action_name: :register_with_password,
registration_enabled?: true,
resettable: nil,
resource: WfdBase.Accounts.User,
sign_in_action_name: :sign_in_with_password,
sign_in_enabled?: true,
sign_in_token_lifetime: {60, :seconds},
sign_in_tokens_enabled?: false,
sign_in_with_token_action_name: :sign_in_with_token_for_password,
strategy_module: AshAuthentication.Strategy.Password
},
caused_by: %Ash.Error.Forbidden{
errors: [
%AshAuthentication.Errors.AuthenticationFailed{
field: nil,
strategy: %AshAuthentication.Strategy.Password{
confirmation_required?: true,
hash_provider: AshAuthentication.BcryptProvider,
hashed_password_field: :hashed_password,
identity_field: :email,
name: :password,
password_confirmation_field: :password_confirmation,
password_field: :password,
provider: :password,
register_action_accept: [],
register_action_name: :register_with_password,
registration_enabled?: true,
resettable: nil,
resource: WfdBase.Accounts.User,
sign_in_action_name: :sign_in_with_password,
sign_in_enabled?: true,
sign_in_token_lifetime: {60, :seconds},
sign_in_tokens_enabled?: false,
sign_in_with_token_action_name: :sign_in_with_token_for_password,
strategy_module: AshAuthentication.Strategy.Password
},
caused_by: %{
message: "Query returned no users",
module: AshAuthentication.Strategy.Password.SignInPreparation,
strategy: %AshAuthentication.Strategy.Password{
confirmation_required?: true,
hash_provider: AshAuthentication.BcryptProvider,
hashed_password_field: :hashed_password,
identity_field: :email,
name: :password,
password_confirmation_field: :password_confirmation,
password_field: :password,
provider: :password,
register_action_accept: [],
register_action_name: :register_with_password,
registration_enabled?: true,
resettable: nil,
resource: WfdBase.Accounts.User,
sign_in_action_name: :sign_in_with_password,
sign_in_enabled?: true,
sign_in_token_lifetime: {60, ...},
sign_in_tokens_enabled?: false,
...
},
action: :sign_in
},
changeset: nil,
query: #Ash.Query<
resource: WfdBase.Accounts.User,
arguments: %{
password: "**redacted**",
email: #Ash.CiString<"asd@gmail.com">
},
filter: #Ash.Filter<email == #Ash.CiString<"asd@gmail.com">>,
select: [:hashed_password, :id, :email]
>,
error_context: [],
vars: [],
path: [],
stacktrace: #Stacktrace<>,
class: :forbidden
}
],
changeset: nil,
query: #Ash.Query<
resource: WfdBase.Accounts.User,
arguments: %{
password: "**redacted**",
email: #Ash.CiString<"asd@gmail.com">
},
filter: #Ash.Filter<email == #Ash.CiString<"asd@gmail.com">>,
errors: [
%AshAuthentication.Errors.AuthenticationFailed{
field: nil,
strategy: %AshAuthentication.Strategy.Password{
confirmation_required?: true,
hash_provider: AshAuthentication.BcryptProvider,
hashed_password_field: :hashed_password,
identity_field: :email,
name: :password,
password_confirmation_field: :password_confirmation,
password_field: :password,
provider: :password,
register_action_accept: [],
register_action_name: :register_with_password,
registration_enabled?: true,
resettable: nil,
resource: WfdBase.Accounts.User,
sign_in_action_name: :sign_in_with_password,
sign_in_enabled?: true,
sign_in_token_lifetime: {60, :seconds},
sign_in_tokens_enabled?: false,
sign_in_with_token_action_name: :sign_in_with_token_for_password,
strategy_module: AshAuthentication.Strategy.Password
},
caused_by: %{
message: "Query returned no users",
module: AshAuthentication.Strategy.Password.SignInPreparation,
strategy: %AshAuthentication.Strategy.Password{
confirmation_required?: true,
hash_provider: AshAuthentication.BcryptProvider,
hashed_password_field: :hashed_password,
identity_field: :email,
name: :password,
password_confirmation_field: :password_confirmation,
password_field: :password,
provider: :password,
register_action_accept: [],
register_action_name: :register_with_password,
registration_enabled?: true,
resettable: nil,
resource: WfdBase.Accounts.User,
sign_in_action_name: :sign_in_with_password,
sign_in_enabled?: true,
...
},
action: :sign_in
},
changeset: nil,
query: #Ash.Query<
resource: WfdBase.Accounts.User,
arguments: %{
password: "**redacted**",
email: #Ash.CiString<"asd@gmail.com">
},
filter: #Ash.Filter<email == #Ash.CiString<"asd@gmail.com">>,
select: [:hashed_password, :id, :email]
>,
error_context: [],
vars: [],
path: [],
stacktrace: #Stacktrace<>,
class: :forbidden
}
],
select: [:id, :email, :hashed_password]
>,
error_context: [nil],
vars: [],
path: [],
stacktrace: #Stacktrace<>,
class: :forbidden
},
changeset: nil,
query: nil,
error_context: [],
vars: [],
path: [],
stacktrace: #Stacktrace<>,
class: :forbidden
}
],
So the user is actually not found, and iâm redirected wit no user âŠ