mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 13:45:44 +08:00
ssh公钥允许token请求
This commit is contained in:
@@ -173,6 +173,14 @@ class ApplicationController < ActionController::Base
|
|||||||
tip_exception(401, "请登录后再操作") unless User.current.logged?
|
tip_exception(401, "请登录后再操作") unless User.current.logged?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def require_login_or_token
|
||||||
|
if params[:token].present?
|
||||||
|
user = User.try_to_autologin(params[:token])
|
||||||
|
User.current = user
|
||||||
|
end
|
||||||
|
tip_exception(401, "请登录后再操作") unless User.current.logged?
|
||||||
|
end
|
||||||
|
|
||||||
def require_profile_completed
|
def require_profile_completed
|
||||||
tip_exception(411, "请完善资料后再操作") unless User.current.profile_is_completed?
|
tip_exception(411, "请完善资料后再操作") unless User.current.profile_is_completed?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class PublicKeysController < ApplicationController
|
class PublicKeysController < ApplicationController
|
||||||
before_action :require_login
|
before_action :require_login_or_token
|
||||||
before_action :find_public_key, only: [:destroy]
|
before_action :find_public_key, only: [:destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
Reference in New Issue
Block a user