Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SessionsController < ApplicationController
- def new
- end
- def create
- auth_hash = request.env['rack.auth']
- unless @auth = Authorization.find_from_auth_hash(auth_hash)
- @auth = Authorization.create_from_auth_hash(auth_hash, current_user)
- end
- self.current_user = @auth.user
- render :text => current_user.authorizations.to_yaml
- end
- def destroy
- if current_user.destroy
- flash[:success] = "You have been logged out successfully!"
- redirect_to new_sessions_path
- else
- flash[:failure] = "You have been logged out successfully!"
- redirect_to queues_path
- end
- end
- end
Add Comment
Please, Sign In to add comment