Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 92bbf80dcd
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (14 sloc) 0.496 kB
class Admins::SessionsController < Devise::OmniauthCallbacksController
def callback
email = request.env['omniauth.auth'].info.to_hash['email'].downcase
if email =~ /@(the)?edgecase.com\Z/
@admin = Admin.find_or_create_by_email(email)
@admin.ensure_authentication_token!
sign_in @admin
flash.notice = "Authorized as #{email}"
else
flash.alert = "#{email} not authorized!"
end
redirect_to request.env['omniauth.origin'] || root_path
end
end
Jump to Line
Something went wrong with that request. Please try again.