Sha256: b8a7a5fab08ab3040d6f6e5b38b270f97f8490246629e4c727356acf27bc8a0d
Contents?: true
Size: 769 Bytes
Versions: 6
Compression:
Stored size: 769 Bytes
Contents
# encoding: utf-8 class SessionsController < ApplicationController def new @title= 'Sign In' end # to refresh the page, must know BEFOREHAND that the action needs refresh # then use attribute 'data-ajax'=>'false' # see app/views/sessions/new.html.erb for sample def create user = User.from_omniauth(env["omniauth.auth"]) session[:user_id] = user.id redirect_to '/mindapp/pending' rescue redirect_to root_path, :alert=> "Authentication failed, please try again." end def destroy session[:user_id] = nil # redirect_to '/mindapp/help' refresh_to root_path end def failure ma_log "Authentication failed, please try again." redirect_to root_path, :alert=> "Authentication failed, please try again." end end
Version data entries
6 entries across 6 versions & 1 rubygems