mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-19 12:52:55 +12:00
feat!: Tokens are now enabled by default.
This commit is contained in:
parent
d697e0313d
commit
03b38bdcb4
4 changed files with 2 additions and 4 deletions
|
@ -118,7 +118,7 @@ Configure JWT settings for this resource
|
|||
| Name | Type | Default | Docs |
|
||||
|------|------|---------|------|
|
||||
| [`token_resource`](#authentication-tokens-token_resource){: #authentication-tokens-token_resource .spark-required} | `module \| false` | | The resource used to store token information, such as in-flight confirmations, revocations, and if `store_all_tokens?` is enabled, authentication tokens themselves. |
|
||||
| [`enabled?`](#authentication-tokens-enabled?){: #authentication-tokens-enabled? } | `boolean` | `false` | Should JWTs be generated by this resource? |
|
||||
| [`enabled?`](#authentication-tokens-enabled?){: #authentication-tokens-enabled? } | `boolean` | `true` | Should JWTs be generated by this resource? |
|
||||
| [`store_all_tokens?`](#authentication-tokens-store_all_tokens?){: #authentication-tokens-store_all_tokens? } | `boolean` | `false` | Store all tokens in the `token_resource`. See the [tokens guide](/documentation/topics/tokens.md) for more. |
|
||||
| [`require_token_presence_for_authentication?`](#authentication-tokens-require_token_presence_for_authentication?){: #authentication-tokens-require_token_presence_for_authentication? } | `boolean` | `false` | Require a locally-stored token for authentication. See the [tokens guide](/documentation/topics/tokens.md) for more. |
|
||||
| [`signing_algorithm`](#authentication-tokens-signing_algorithm){: #authentication-tokens-signing_algorithm } | `String.t` | `"HS256"` | The algorithm to use for token signing. Available signing algorithms are; EdDSA, Ed448ph, Ed448, Ed25519ph, Ed25519, PS512, PS384, PS256, ES512, ES384, ES256, RS512, RS384, RS256, HS512, HS384 and HS256. |
|
||||
|
|
|
@ -184,7 +184,6 @@ defmodule MyApp.Accounts.User do
|
|||
end
|
||||
|
||||
tokens do
|
||||
enabled? true
|
||||
token_resource MyApp.Accounts.Token
|
||||
signing_secret fn _, _ ->
|
||||
Application.fetch_env(:my_app, :token_signing_secret)
|
||||
|
|
|
@ -77,7 +77,7 @@ defmodule AshAuthentication.Dsl do
|
|||
doc: """
|
||||
Should JWTs be generated by this resource?
|
||||
""",
|
||||
default: false
|
||||
default: true
|
||||
],
|
||||
store_all_tokens?: [
|
||||
type: :boolean,
|
||||
|
|
|
@ -23,7 +23,6 @@ defmodule AshAuthentication.Jwt do
|
|||
|
||||
authentication do
|
||||
tokens do
|
||||
enabled? true
|
||||
token_lifetime 32
|
||||
signing_secret fn _, _ ->
|
||||
System.fetch_env("TOKEN_SIGNING_SECRET")
|
||||
|
|
Loading…
Reference in a new issue