auth_token
ユーザーがログインするたびに新しいトークンを生成したいフィールドがあります。だから私はその行を書きます(2)
が、うまくいきません。ユーザーは正常にログインしますが、フィールドauth_token
は更新されません。
誰でもこれを説明できますか?
if login(params[:email], params[:password])
current_user.update(auth_token: 'sfd') #(2)
flash[:success] = 'Welcome back!'
redirect_to root_path
else
flash.now[:warning] = 'E-mail and/or password is incorrect.'
render 'new'
end
PS私はSorcery
gemを使用しました