BigSpaces
Coming from previous thread: Failing To Create New User
I can now create users, but when I try to sign in from the admin dashboard, I press the “run query” button and I get the following message in the console. After that, I am unable to act as this user from the admin dashboard.
warning: Query has already been validated for action :sign_in_with_password.
For safety, we prevent any changes after that point because they will bypass validations or other action logic.
However, you should prefer a pattern like the below, which makes any custom modifications *before* calling the action.
Resource
|> Ash.Query.new()
|> Ash.Query.set_argument(...)
|> Ash.Query.for_read(...)
(ash 2.15.19) lib/ash/query/query.ex:1568: Ash.Query.set_argument/3
(stdlib 5.0.2) maps.erl:416: :maps.fold_1/4
(ash 2.15.19) lib/ash/query/query.ex:429: Ash.Query.for_read/4
(ash_admin 0.9.5) lib/ash_admin/components/resource/data_table.ex:230: anonymous fn/2 in AshAdmin.Components.Resource.DataTable.update/2
(ash_phoenix 1.2.20) lib/ash_phoenix/live_view.ex:173: AshPhoenix.LiveView.keep_live/4
(ash_admin 0.9.5) lib/ash_admin/components/resource/data_table.ex:222: AshAdmin.Components.Resource.DataTable.update/2
(phoenix_live_view 0.20.1) lib/phoenix_live_view/utils.ex:498: Phoenix.LiveView.Utils.maybe_call_update!/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:659: anonymous fn/6 in Phoenix.LiveView.Diff.render_pending_components/6
(elixir 1.15.4) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:635: anonymous fn/4 in Phoenix.LiveView.Diff.render_pending_components/6
(stdlib 5.0.2) maps.erl:416: :maps.fold_1/4
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:629: Phoenix.LiveView.Diff.render_pending_components/6
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:143: Phoenix.LiveView.Diff.render/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:919: Phoenix.LiveView.Channel.render_diff/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:555: Phoenix.LiveView.Channel.mount_handle_params_result/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:1129: Phoenix.LiveView.Channel.verified_mount/8
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:84: Phoenix.LiveView.Channel.handle_info/2
(stdlib 5.0.2) gen_server.erl:1077: :gen_server.try_handle_info/3
warning: Query has already been validated for action :sign_in_with_password.
For safety, we prevent any changes after that point because they will bypass validations or other action logic.
However, you should prefer a pattern like the below, which makes any custom modifications *before* calling the action.
Resource
|> Ash.Query.new()
|> Ash.Query.set_argument(...)
|> Ash.Query.for_read(...)
(ash 2.15.19) lib/ash/query/query.ex:1568: Ash.Query.set_argument/3
(stdlib 5.0.2) maps.erl:416: :maps.fold_1/4
(ash 2.15.19) lib/ash/query/query.ex:429: Ash.Query.for_read/4
(ash_admin 0.9.5) lib/ash_admin/components/resource/data_table.ex:230: anonymous fn/2 in AshAdmin.Components.Resource.DataTable.update/2
(ash_phoenix 1.2.20) lib/ash_phoenix/live_view.ex:173: AshPhoenix.LiveView.keep_live/4
(ash_admin 0.9.5) lib/ash_admin/components/resource/data_table.ex:222: AshAdmin.Components.Resource.DataTable.update/2
(phoenix_live_view 0.20.1) lib/phoenix_live_view/utils.ex:498: Phoenix.LiveView.Utils.maybe_call_update!/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:659: anonymous fn/6 in Phoenix.LiveView.Diff.render_pending_components/6
(elixir 1.15.4) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:635: anonymous fn/4 in Phoenix.LiveView.Diff.render_pending_components/6
(stdlib 5.0.2) maps.erl:416: :maps.fold_1/4
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:629: Phoenix.LiveView.Diff.render_pending_components/6
(phoenix_live_view 0.20.1) lib/phoenix_live_view/diff.ex:143: Phoenix.LiveView.Diff.render/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:919: Phoenix.LiveView.Channel.render_diff/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:555: Phoenix.LiveView.Channel.mount_handle_params_result/3
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:1129: Phoenix.LiveView.Channel.verified_mount/8
(phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:84: Phoenix.LiveView.Channel.handle_info/2
(stdlib 5.0.2) gen_server.erl:1077: :gen_server.try_handle_info/3
[debug] QUERY OK source="users" db=1.0ms queue=0.8ms idle=1868.1ms
SELECT u0."id", u0."email", u0."hashed_password" FROM "users" AS u0 WHERE (u0."email"::citext = $1::citext) LIMIT $2 ["test@test.test", 1000]
I hope you can point me in the right direction to troubleshoot! Appreciate it in advance.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
So, acting as a user in the admin dashboard is not done via signing in like this. We should fix this issue, but the way that this works is that you specify that a resource is an “Actor” type in the resource itself and then you can log in without knowing the username and password.
Then you can go to the user resource and find a user and click on the key icon next to the user.
zachdaniel
I’ve pushed a fix up to the
mainbranch ofash_admin. Would you mind trying it out to see if it resolves your issue?BigSpaces
Thank you @zachdaniel
I have set my user as an actor with the code:
Now I see the “set user” on the top right. When I click there, nothing happens.
If I go to the option “Get By Subject”, I get this on the screen, without any errors on the console:
* expected at most one result but got at least 2 in query: #Ash.Query<resource: Memento.Accounts.User, limit: 1000, select: [:id, :email, :hashed_password]>I have also deleted the
ash_adminfolder in thedepsfolder, as well as the_buildfolder, and recompiled again. Will this download your fix from the main branch ofash_admin?Thanks again for all your support!
zachdaniel
Is “Get By Subject” an action on user? Or on tokens? Do you have
actor? trueset on user? Or on token?BigSpaces
Get by subject on
user. Andactor? trueon userzachdaniel
Got this reproduced, will take a look now
zachdaniel
So, making the
get_by_subjectaction work in the admin is probably not the most important thing at the moment. Do you have a primary read action on user?EDIT: because if so, you should switch to that action and use it to select the user. If not, you should add one and use it
BigSpaces
Hmmm, what I see is this:
My user resource comes directly from the getting started guide
zachdaniel
Add this:
zachdaniel
I’ve added an issue to track this. It’s an issue of the generated actions used by
ash_authentication. `get_by_subject` action is configured as `get? true` but does not have any arguments or filters · Issue #486 · team-alembic/ash_authentication · GitHub