我正在使用设计进行身份验证,我可以登录但无法保持登录状态。
我用邮递员发布数据,我得到了这个回复。好像我登录了。
{
"id": 1,
"first_name": "dadada",
"last_name": "dadadada",
"email": "test@example.com",
"created_at": "2016-12-19T12:24:59.000+09:00",
"updated_at": "2016-12-19T17:11:09.000+09:00"
}
接下来我获得了UsersController的信息操作。
{
"error": 'You have to confirm your account before continuing.'
}
有办法保持登录吗?
谢谢!
class Users::SessionsController < Devise::SessionsController
respond_to :json
def new
super
end
def create
super
end
def destroy
super
end
end
class Users::UsersController < ApplicationController
before_action :authenticate_user!
respond_to :json
def info
render json: current_user.attributes, status: 200
end
def user_entry
end
end