File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
app/models/api_session_recovering Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ def setup_expire_at
3131 def send_token
3232 restore_password_methods = ApiSessionRecovering . configuration . restore_password_methods
3333
34- ApiSessionRecovering ::RestorePasswordMailer . email ( self ) . deliver_later if restore_password_methods . include? : email
34+ ApiSessionRecovering ::RestorePasswordMailer . email ( self ) . deliver_later if restore_password_methods . include? ( :email ) && email
3535
36- ApiSessionRecovering ::TwilioService . new ( self ) . send_sms if restore_password_methods . include? :sms
36+ ApiSessionRecovering ::TwilioService . new ( self ) . send_sms if restore_password_methods . include? ( :sms ) && phone
3737 end
3838
3939 def generate_token
40- self . token = SecureRandom . random_number ( 999999 )
40+ self . token = rand ( 100000 .. 999999 )
4141
4242 generate_token if ApiSessionRecovering ::RestorePassword . exists? ( token : self . token , user : self . user )
4343 end
Original file line number Diff line number Diff line change 4040 #
4141 # => Phone for sending sms (For recovering password via sms uncomment line below)
4242 #
43- # config.phone_from { '+1**********' }
43+ # config.phone_from = '+1**********'
4444
4545 # config.allowed_password_reset_validations_per_day_count = 20
4646
You can’t perform that action at this time.
0 commit comments