Sha256: 239f0965239a9d8df9916f639ce37eda59351f0f15ef87b509383f42f7491c66
Contents?: true
Size: 891 Bytes
Versions: 3
Compression:
Stored size: 891 Bytes
Contents
module Applicaster module SessionsControllerMixin def new redirect_to "/auth/applicaster" end def create session[:omniauth_credentials] = auth_hash.credentials.to_hash redirect_to(session.delete(:path_before_login) || '/') end def destroy reset_session redirect_to "/" end def failure Rails.logger.warn({ message: "Omniauth error with strategy '#{params[:strategy]}': #{params[:message]}", origin: params[:origin], }) flash[:notice] = "There was a problem logging in" redirect_to "/" end protected def auth_hash request.env['omniauth.auth'] end def access_token @access_token ||= OAuth2::AccessToken.new( client, auth_hash.credentials.token, auth_hash.credentials.to_hash.except("token", "expires"), ) end end end
Version data entries
3 entries across 3 versions & 1 rubygems