mirror of
https://github.com/9001/copyparty.git
synced 2026-04-13 07:32:49 -06: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:
parent
7908d880da
commit
1272de9de5
|
|
@ -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
|
||||||
|
if old_accs.get(uname) in groupless:
|
||||||
gname = ""
|
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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue