forked from Gitlink/forgeplus
auth token 接入验证登录接口
This commit is contained in:
parent
5c793088fa
commit
41eedff819
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue