FIX: Create email token with correct scope (#15658)

`account_created` email contains a URL to `/u/password-reset/TOKEN`
which means that the correct scope for the email token is
`password_reset`, not `signup`.
This commit is contained in:
Dan Ungureanu 2022-01-20 16:38:56 +02:00 committed by GitHub
parent 6a48106ed4
commit f0c1a4fab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ task "admin:invite", [:email] => [:environment] do |_, args|
user.email_tokens.update_all confirmed: true
puts "Sending email!"
email_token = user.email_tokens.create!(email: user.email, scope: EmailToken.scopes[:signup])
email_token = user.email_tokens.create!(email: user.email, scope: EmailToken.scopes[:password_reset])
Jobs.enqueue(:user_email, type: :account_created, user_id: user.id, email_token: email_token.token)
end