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

23 lines
540 B
Ruby
Raw Normal View History

2009-12-30 12:19:33 -05:00
class UnlocksController < ApplicationController
2010-01-13 12:12:13 -05:00
include Devise::Controllers::InternalHelpers
include Devise::Controllers::Common
2009-12-30 12:19:33 -05:00
# GET /resource/unlock?unlock_token=abcdef
def show
self.resource = resource_class.unlock!(:unlock_token => params[:unlock_token])
if resource.errors.empty?
set_flash_message :notice, :unlocked
2009-12-30 12:19:33 -05:00
sign_in_and_redirect(resource_name, resource)
else
render_with_scope :new
end
end
2010-01-13 12:12:13 -05:00
protected
def send_instructions_with
:send_unlock_instructions
end
2009-12-30 12:19:33 -05:00
end