mirror of
https://github.com/9001/copyparty.git
synced 2026-10-05 22:04:38 +01:00
idp: fix groups for hybrid users;
if idp-store is 2 or less, and a user is defined both in config and by idp, then config would reload for every request with groups attached
This commit is contained in:
@@ -3312,20 +3312,22 @@ class AuthSrv(object):
|
|||||||
cur.close()
|
cur.close()
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
old_accs = self.idp_accs.copy()
|
||||||
self.idp_accs.clear()
|
self.idp_accs.clear()
|
||||||
self.idp_usr_gh.clear()
|
self.idp_usr_gh.clear()
|
||||||
|
|
||||||
gsep = self.args.idp_gsep
|
gsep = self.args.idp_gsep
|
||||||
|
groupless = (None, [""])
|
||||||
n = []
|
n = []
|
||||||
for uname, gname in from_cache:
|
for uname, gname in from_cache:
|
||||||
if level < 3:
|
if level < 3:
|
||||||
if uname in self.idp_accs:
|
if uname in self.idp_accs:
|
||||||
continue
|
continue
|
||||||
gname = ""
|
if old_accs.get(uname) in groupless:
|
||||||
|
gname = ""
|
||||||
gnames = [x.strip() for x in gsep.split(gname)]
|
gnames = [x.strip() for x in gsep.split(gname)]
|
||||||
gnames.sort()
|
gnames.sort()
|
||||||
|
|
||||||
# self.idp_usr_gh[uname] = gname
|
|
||||||
self.idp_accs[uname] = gnames
|
self.idp_accs[uname] = gnames
|
||||||
n.append(uname)
|
n.append(uname)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user