mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Add user accounts, roles, and admin gating
- Scaffold password auth (email or username) with phx.gen.auth; no magic links - Add role (member/moderator/admin/super_admin) and plan (free/premium) enums - Gate /admin behind admin-or-above via plug + on_mount; hide the nav link - Add mix accounts.promote for CLI role changes - Disable email confirmation by confirming accounts at registration Closes #3
This commit is contained in:
@@ -7,6 +7,19 @@
|
||||
# General application configuration
|
||||
import Config
|
||||
|
||||
config :chesstrainer, :scopes,
|
||||
user: [
|
||||
default: true,
|
||||
module: Chesstrainer.Accounts.Scope,
|
||||
assign_key: :current_scope,
|
||||
access_path: [:user, :id],
|
||||
schema_key: :user_id,
|
||||
schema_type: :binary_id,
|
||||
schema_table: :users,
|
||||
test_data_fixture: Chesstrainer.AccountsFixtures,
|
||||
test_setup_helper: :register_and_log_in_user
|
||||
]
|
||||
|
||||
config :chesstrainer,
|
||||
ecto_repos: [Chesstrainer.Repo],
|
||||
generators: [timestamp_type: :utc_datetime]
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import Config
|
||||
|
||||
# Only in tests, remove the complexity from the password hashing algorithm
|
||||
config :bcrypt_elixir, :log_rounds, 1
|
||||
|
||||
# Point the local Fathom backend at the committed 3-piece fixtures.
|
||||
config :chesstrainer, :tablebase_path, Path.expand("../test/fixtures/tablebase", __DIR__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user