1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Merge pull request #4066 from sbc100/friendly_token

Friendly token
This commit is contained in:
José Valim 2016-04-30 10:03:04 +02:00
commit fdd9337b64
3 changed files with 3 additions and 4 deletions

View file

@ -235,8 +235,7 @@ module Devise
if self.confirmation_token && !confirmation_period_expired?
@raw_confirmation_token = self.confirmation_token
else
raw, _ = Devise.token_generator.generate(self.class, :confirmation_token)
self.confirmation_token = @raw_confirmation_token = raw
self.confirmation_token = @raw_confirmation_token = Devise.friendly_token
self.confirmation_sent_at = Time.now.utc
end
end

View file

@ -64,7 +64,7 @@ module Devise
def send_unlock_instructions
raw, enc = Devise.token_generator.generate(self.class, :unlock_token)
self.unlock_token = enc
self.save(validate: false)
save(validate: false)
send_devise_notification(:unlock_instructions, raw, {})
raw
end

View file

@ -99,7 +99,7 @@ module Devise
self.reset_password_token = enc
self.reset_password_sent_at = Time.now.utc
self.save(validate: false)
save(validate: false)
raw
end