12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/groovestack/auth/passwordless/magic_links_controller.rb', line 12
def show
self.resource = warden.authenticate!(auth_options)
begin
unless resource.confirmed?
resource.skip_confirmation_notification! resource.confirm
end
rescue StandardError => e
msg = "Passwordless Magic Link Confirmation Failure: #{e}"
::Groovestack::Base.notify_error(e.class, msg)
end
set_flash_message!(:notice, :signed_in)
sign_in(resource_name, resource, event: :authentication)
yield resource if block_given?
respond_to do |format|
format.html { redirect_to after_sign_in_path_for(resource) }
format.json { render json: { success: true, resource: resource.as_json, status: :ok } }
end
end
|