2022-07-20 16:30:47 +00:00
|
|
|
From e3c0995160a653ef6cd8784b255036585b273b82 Mon Sep 17 00:00:00 2001
|
|
|
|
From: stuebinm <stuebinm@disroot.org>
|
|
|
|
Date: Wed, 20 Jul 2022 18:02:15 +0200
|
|
|
|
Subject: [PATCH] magic gitea patch
|
|
|
|
|
|
|
|
---
|
|
|
|
uffd/oauth2/views.py | 9 +++++++++
|
|
|
|
1 file changed, 9 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/uffd/oauth2/views.py b/uffd/oauth2/views.py
|
|
|
|
index d13fd42..94352be 100644
|
|
|
|
--- a/uffd/oauth2/views.py
|
|
|
|
+++ b/uffd/oauth2/views.py
|
|
|
|
@@ -230,6 +230,15 @@ def oauth_required(*scopes):
|
|
|
|
@oauth_required('profile')
|
|
|
|
def userinfo():
|
|
|
|
user = request.oauth.user
|
|
|
|
+ client = request.oauth.client_id
|
2024-02-25 22:24:07 +00:00
|
|
|
+ if client == "forgejo":
|
2022-07-20 16:30:47 +00:00
|
|
|
+ return jsonify(
|
|
|
|
+ id=user.unix_uid,
|
|
|
|
+ full_name=user.displayname,
|
|
|
|
+ login=user.loginname,
|
|
|
|
+ email=user.mail,
|
|
|
|
+ groups=[group.name for group in user.groups]
|
|
|
|
+ )
|
|
|
|
return jsonify(
|
|
|
|
id=user.unix_uid,
|
|
|
|
name=user.displayname,
|
|
|
|
--
|
|
|
|
2.36.0
|
|
|
|
|