class AuthController < ActionController::Base include ShopliftClient protect_from_forgery with: :exception def auth response = client.auth_code.get_token params[:code], redirect_uri: Rails.configuration.settings['authlift_redirect_uri'], scope: scope self.session_cookie = response.token previous_url = session[:previous_url] session.delete :previous_url redirect_to(previous_url || '/') end def destroy authenticate_user! return if current_user.blank? signouttoken = session_cookie session_cookie = nil redirect_to "#{Rails.configuration.settings['authlift_url']}users/sign_outx?signouttoken=#{signouttoken}" end end