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:
parent
6a48106ed4
commit
f0c1a4fab8
|
@ -27,7 +27,7 @@ task "admin:invite", [:email] => [:environment] do |_, args|
|
||||||
user.email_tokens.update_all confirmed: true
|
user.email_tokens.update_all confirmed: true
|
||||||
|
|
||||||
puts "Sending email!"
|
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)
|
Jobs.enqueue(:user_email, type: :account_created, user_id: user.id, email_token: email_token.token)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue