mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
oauth2 增加client方式
This commit is contained in:
@@ -513,7 +513,7 @@ Doorkeeper::JWT.configure do
|
||||
# about the user. Defaults to a randomly generated token in a hash:
|
||||
# { token: "RANDOM-TOKEN" }
|
||||
token_payload do |opts|
|
||||
user = User.find(opts[:resource_owner_id])
|
||||
user = User.find_by(id: opts[:resource_owner_id])
|
||||
|
||||
{
|
||||
iss: 'GitLink',
|
||||
@@ -523,9 +523,9 @@ Doorkeeper::JWT.configure do
|
||||
jti: SecureRandom.uuid,
|
||||
|
||||
user: {
|
||||
id: user.id,
|
||||
login: user.login,
|
||||
mail: user.mail
|
||||
id: user&.id,
|
||||
login: user&.login,
|
||||
mail: user&.mail
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user