FIX api bug

This commit is contained in:
jasder 2021-04-02 18:40:26 +08:00
parent e022e429d4
commit 6ce4b26047
2 changed files with 3 additions and 2 deletions

View File

@ -234,7 +234,7 @@ class UsersController < ApplicationController
end end
def sync_user_info def sync_user_info
user = User.find_by_mail params[:email] user = User.find_by_login params[:login]
return render_forbidden unless user === current_user return render_forbidden unless user === current_user
sync_params = { sync_params = {

View File

@ -1,8 +1,9 @@
class Users::UpdateInfoForm class Users::UpdateInfoForm
include ActiveModel::Model include ActiveModel::Model
attr_accessor :email, :password attr_accessor :email, :password, :login
validates :email, presence: true, format: { with: CustomRegexp::EMAIL } validates :email, presence: true, format: { with: CustomRegexp::EMAIL }
validates :password, presence: true validates :password, presence: true
validates :login, presence: true
end end