mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
auth token 接入验证登录接口
This commit is contained in:
@@ -170,7 +170,8 @@ class ApplicationController < ActionController::Base
|
||||
# 未授权的捕捉407,弹试用申请弹框
|
||||
def require_login
|
||||
#6.13 -hs
|
||||
|
||||
tip_exception(401, "请登录后再操作") unless valid_doorkeeper_token?
|
||||
User.current = User.find_by(id: @doorkeeper_token.resource_owner_id)
|
||||
tip_exception(401, "请登录后再操作") unless User.current.logged?
|
||||
end
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ Doorkeeper::JWT.configure do
|
||||
user = User.find(opts[:resource_owner_id])
|
||||
|
||||
{
|
||||
iss: 'My App',
|
||||
iss: 'GitLink',
|
||||
iat: Time.current.utc.to_i,
|
||||
|
||||
# @see JWT reserved claims - https://tools.ietf.org/html/draft-jones-json-web-token-07#page-7
|
||||
|
||||
Reference in New Issue
Block a user