diff options
| author | Simponic <loganhunt@simponic.xyz> | 2022-12-30 05:46:35 -0700 |
|---|---|---|
| committer | Simponic <loganhunt@simponic.xyz> | 2022-12-30 05:46:35 -0700 |
| commit | 42425b02260d279cd9c12fb3e625282979b9e308 (patch) | |
| tree | 0412bf9f39d44266cff94082c499e44e5f6e60f5 /lib/chessh/schema/player.ex | |
| parent | 60eea1b4ed65bc7cfce1e383dac6de9d004540eb (diff) | |
| download | chessh-42425b02260d279cd9c12fb3e625282979b9e308.tar.gz chessh-42425b02260d279cd9c12fb3e625282979b9e308.zip | |
Add scalable session thresholds
Diffstat (limited to 'lib/chessh/schema/player.ex')
| -rw-r--r-- | lib/chessh/schema/player.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chessh/schema/player.ex b/lib/chessh/schema/player.ex index 4b6a324..8eaffee 100644 --- a/lib/chessh/schema/player.ex +++ b/lib/chessh/schema/player.ex @@ -9,11 +9,18 @@ defmodule Chessh.Player do field(:password, :string, virtual: true) field(:hashed_password, :string) + field(:authentications, :integer, default: 0) + has_many(:keys, Chessh.Key) timestamps() end + def authentications_changeset(player, attrs) do + player + |> cast(attrs, [:authentications]) + end + def registration_changeset(player, attrs, opts \\ []) do player |> cast(attrs, [:username, :password]) |
