Sha256: 9a5d8ec777339e9e7399574379a150ad98cd4bc7f0efc3dc503fc8b44f56abc7
Contents?: true
Size: 668 Bytes
Versions: 16
Compression:
Stored size: 668 Bytes
Contents
# coding: utf-8 class SessionsController < ApplicationController #----------# # callback # #----------# def callback auth = request.env["omniauth.auth"] user = User.where( provider: auth["provider"], uid: auth["uid"] ).first || User.create_with_omniauth( auth ) session[:user_id] = user.id redirect_to :root, notice: "ログインしました。" end #---------# # destroy # #---------# def destroy session[:user_id] = nil redirect_to :root, notice: "ログアウトしました。" end #---------# # failure # #---------# def failure render text: "<span style='color: red;'>Auth Failure</span>" end end
Version data entries
16 entries across 16 versions & 1 rubygems