Guest User

Untitled

a guest
Jun 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. class SessionsController < ApplicationController
  2. def new
  3.  
  4. end
  5.  
  6. def create
  7. auth_hash = request.env['rack.auth']
  8. unless @auth = Authorization.find_from_auth_hash(auth_hash)
  9. @auth = Authorization.create_from_auth_hash(auth_hash, current_user)
  10. end
  11. self.current_user = @auth.user
  12.  
  13. render :text => current_user.authorizations.to_yaml
  14. end
  15.  
  16. def destroy
  17. if current_user.destroy
  18. flash[:success] = "You have been logged out successfully!"
  19. redirect_to new_sessions_path
  20. else
  21. flash[:failure] = "You have been logged out successfully!"
  22. redirect_to queues_path
  23. end
  24. end
  25. end
Add Comment
Please, Sign In to add comment