Class: Authorizme::SessionsController
- Inherits:
-
AuthorizmeController
- Object
- ApplicationController
- AuthorizmeController
- Authorizme::SessionsController
- Defined in:
- app/controllers/authorizme/sessions_controller.rb
Instance Method Summary collapse
Methods inherited from AuthorizmeController
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/controllers/authorizme/sessions_controller.rb', line 4 def create user = User.find(:first, :conditions => [ "lower(email) = ?", params[:email].downcase ]) if user && user.authenticate(params[:password]) login user respond_with({status: "logged_in", user: user}, :location => Authorizme::after_login_path) else respond_with({status: "authorization_faild", user: user}, {:location => Authorizme::not_logged_in_path, :status => :not_found}) end end |
#destroy ⇒ Object
14 15 16 |
# File 'app/controllers/authorizme/sessions_controller.rb', line 14 def destroy logout end |