Sha256: fe382e78d5ae027939b772318b2394fbd25e70861e5a881f4b2ec92dea52b96e
Contents?: true
Size: 506 Bytes
Versions: 10
Compression:
Stored size: 506 Bytes
Contents
class Auth::NewPasswordForm < ApplicationForm attr_accessor :token, :password, :password_confirmation validates :token, presence: true validates :password, presence: true, confirmation: true, length: { minimum: 8 } def reset? return false if invalid? user = User.find_by_token_for(:password_reset, @token) if user.nil? errors.add(:password, message: 'This password reset token is invalid.') return false end user.update(password: @password) true end end
Version data entries
10 entries across 10 versions & 1 rubygems