csos95
csos95
AEAsh Elixir
Created by Stefan Wintermeyer on 1/29/2023 in #support
Use secret_key_base as token_signing_secret
Application.get_env(:my_app, MyAppWeb.Endpoint)[:secret_key_base]
7 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Should I use the bug or proposal template?
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Yes, that fixed it.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Oh! I didn't check that. It's the select-fields branch, right?
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
I think now my issue has been solved/worked around so I can use it. Do you want me to mark it as solved and close or wait for that ash authentication fix to be pushed?
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Do you mean setting a cookie or something else?
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Yup, that works for me.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
I tried adding a calculation field that's just an empty string and then setting the token value in the resolution modifier, but it seems like the calculation value overwrites it.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
So with that sorted out, how would I actually retrieve the token on the client? I see that the token gets put under the __metadata__ field in the user value, but the final return value is a user which has no token field that I can put it in with the resolution modifier.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
🥳
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Yeah
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Aha! Yeah, if I remove the private? true and select that field, signing in works.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
I just pushed a commit with the defimpl added.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Yeah
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
And the generated migration does have a unique index.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
Yeah, same result with freshly generated resources/database and only running register once.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
I think so, but I'll reset it and check again. When I do the register action with the same name it returns a null result and I see the db rollback message in the terminal.
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
I had thought that the identities part generated an index, but I guess not.
identities do
identity :unique_name, [:name]
end
identities do
identity :unique_name, [:name]
end
127 replies
AEAsh Elixir
Created by csos95 on 1/27/2023 in #support
Issues using AshAuthentication's sign_in_with_password action with AshGraphql
%AshAuthentication.Errors.AuthenticationFailed{
caused_by: %{
action: :sign_in,
message: "Query returned too many users",
module: AshAuthentication.Strategy.Password.SignInPreparation,
strategy: %AshAuthentication.Strategy.Password{
identity_field: :name,
hashed_password_field: :hashed_password,
hash_provider: AshAuthentication.BcryptProvider,
confirmation_required?: true,
password_field: :password,
password_confirmation_field: :password_confirmation,
register_action_name: :register_with_password,
sign_in_action_name: :sign_in_with_password,
resettable: [],
name: :password,
provider: :password,
resource: Coruscant.Accounts.User
}
},
changeset: nil,
query: #Ash.Query<
resource: Coruscant.Accounts.User,
arguments: %{name: "foo", password: "**redacted**"},
filter: #Ash.Filter<name == "foo">,
select: [:id, :name]
>,
error_context: [],
vars: [],
path: [],
stacktrace: #Stacktrace<>,
class: :forbidden
}
%AshAuthentication.Errors.AuthenticationFailed{
caused_by: %{
action: :sign_in,
message: "Query returned too many users",
module: AshAuthentication.Strategy.Password.SignInPreparation,
strategy: %AshAuthentication.Strategy.Password{
identity_field: :name,
hashed_password_field: :hashed_password,
hash_provider: AshAuthentication.BcryptProvider,
confirmation_required?: true,
password_field: :password,
password_confirmation_field: :password_confirmation,
register_action_name: :register_with_password,
sign_in_action_name: :sign_in_with_password,
resettable: [],
name: :password,
provider: :password,
resource: Coruscant.Accounts.User
}
},
changeset: nil,
query: #Ash.Query<
resource: Coruscant.Accounts.User,
arguments: %{name: "foo", password: "**redacted**"},
filter: #Ash.Filter<name == "foo">,
select: [:id, :name]
>,
error_context: [],
vars: [],
path: [],
stacktrace: #Stacktrace<>,
class: :forbidden
}
127 replies