ADD sync users salt column
This commit is contained in:
parent
3b6cbacbd1
commit
45b2e5bf96
|
@ -131,6 +131,15 @@ class UsersController < ApplicationController
|
||||||
interactor.success? ? render_ok : render_error(interactor.error)
|
interactor.success? ? render_ok : render_error(interactor.error)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
# 同步trusite平台用户的salt信息,只需同步一次,同步完成后,该方法可以删除
|
||||||
|
def sync_salt
|
||||||
|
user = User.find_by_login params[:login]
|
||||||
|
return if user.blank?
|
||||||
|
user.update_column(:salt, params[:salt])
|
||||||
|
render_ok
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def load_user
|
def load_user
|
||||||
@user = User.find_by_login(params[:id]) || User.find_by(id: params[:id])
|
@user = User.find_by_login(params[:id]) || User.find_by(id: params[:id])
|
||||||
|
|
|
@ -149,6 +149,7 @@ Rails.application.routes.draw do
|
||||||
post :sync_token
|
post :sync_token
|
||||||
get :projects
|
get :projects
|
||||||
post :sync_gitea_pwd
|
post :sync_gitea_pwd
|
||||||
|
post :sync_salt
|
||||||
end
|
end
|
||||||
|
|
||||||
scope module: :users do
|
scope module: :users do
|
||||||
|
|
Loading…
Reference in New Issue