Login using Outlook showing cookie overflow error

巧了我就是萌 提交于 2020-02-06 19:00:33

问题


I am implementing outlook signup/signin in my Rails app for authentication from scratch without using Devise or another library or gem. I have followed the official microsoft blog For integrating outlook signin in Rails app But I am failing to implement the final step and it shows->

I have understood the problem , that the storing size of token exceeds the available cookie size

I have successfully done all of the steps just When I try to store the token, it gives error

    class AuthController < ApplicationController
      include AuthHelper

      def gettoken
        token = get_token_from_code params[:code]
        session[:azure_token] = token.to_hash
        redirect_to users_path
      end

    end

And I have sessions controller for normal email signin->
class SessionsController < ApplicationController
  include AuthHelper

  def new
    @login_url = get_login_url
  end

  def create
    user= User.find_by_email(params[:email])
    if user && user.authenticate(params[:password])
      if user.email_confirmed
        session[:user_id] = user.id
        redirect_to root_path, info: "Logged In!"
      else
        redirect_to new_user_path, flash: { warning: "PLease confirm your email before login !" }
      end
    else
      flash.now[:warning] = "Email or Password invalid !"
      render "new"
    end
  end

  def destroy
    session[:user_id] = nil
    redirect_to root_url, notice: "Logged out!"
  end
end

And I am also using normal email signin so How do I integrate both normal email signup/signin AND Outlook signin. Here is the complete code reference in case you need other associated codes-Git code for the app

来源:https://stackoverflow.com/questions/57447558/login-using-outlook-showing-cookie-overflow-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!