fix: use direct changeset to confirm test user email
Accounts.confirm_user_email/1 doesn't exist - the module only has confirm_user/1 which requires a token. For seeding, we can directly set confirmed_at timestamp using Ecto.Changeset.change/2.
This commit is contained in:
parent
e7a25a5f2c
commit
9e236225b1
1 changed files with 5 additions and 2 deletions
|
|
@ -21,8 +21,11 @@ test_totp_secret = "JBSWY3DPEHPK3PXP"
|
|||
privacy_policy_consent: true
|
||||
})
|
||||
|
||||
# Confirm the user's email
|
||||
{:ok, _user} = Accounts.confirm_user_email(user.email)
|
||||
# Confirm the user's email directly (bypass token flow for seeding)
|
||||
{:ok, user} =
|
||||
user
|
||||
|> Ecto.Changeset.change(%{confirmed_at: DateTime.truncate(DateTime.utc_now(), :second)})
|
||||
|> Repo.update()
|
||||
|
||||
# Enable TOTP for the user
|
||||
{:ok, _credential} =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue