You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have one Rails application where I am using salesforce omniauth
I am able to logout by making reset_session. But I am not completely logout from salesforce as when user again click login it will redirect to omniauth and login automatically.
I did below steps
gem 'omniauth-salesforce'
and model
class User < ActiveRecord::Base
def self.from_omniauth(auth)
where(auth.slice(:provider, :uid).permit!).first_or_initialize.tap do |user|
user.provider = auth.provider
user.uid = auth.uid
user.name = auth.info.name
user.oauth_token = auth.credentials.token
user.refresh_token = auth.credentials.refresh_token
user.instance_url = auth.credentials.instance_url
user.save!
end
end
end
class SessionsController < ApplicationController
def create
user = User.from_omniauth(env["omniauth.auth"])
session[:user_id] = user.id
redirect_to root_url
end
def destroy
session[:user_id] = nil
redirect_to root_url
end
end
end
I am new on salesforce omniauth. Please suggest how can I able to logout from my app as well as salesforce both.
The text was updated successfully, but these errors were encountered:
I have one Rails application where I am using salesforce omniauth
I am able to logout by making reset_session. But I am not completely logout from salesforce as when user again click login it will redirect to omniauth and login automatically.
I did below steps
gem 'omniauth-salesforce'
and model
I am new on salesforce omniauth. Please suggest how can I able to logout from my app as well as salesforce both.
The text was updated successfully, but these errors were encountered: