mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-20 05:13:10 +12:00
d5c5d6b6c5
* Adds the `require_token_presence_for_authentication?` DSL option to the Authentication extension which when enabled changes the following behaviour: 1. The `store_in_session` plug will store the user's token rather than their subject in the session. 2. The `retrieve_from_session` plug will look for a stored token in the session rather than a subject and ensure that it's present in the `TokenResource`. 3. The `retrieve_from_bearer` plug will ensure that the token is present in the `TokenResource`. * Adds the `get_token` action to the `TokenResource`.
13 lines
384 B
Elixir
13 lines
384 B
Elixir
defmodule AshAuthenticationTest do
|
|
@moduledoc false
|
|
use DataCase, async: true
|
|
import AshAuthentication
|
|
doctest AshAuthentication
|
|
|
|
describe "authenticated_resources/0" do
|
|
test "it correctly locates all authenticatable resources" do
|
|
assert [Example.User, Example.UserWithTokenRequired] =
|
|
authenticated_resources(:ash_authentication)
|
|
end
|
|
end
|
|
end
|