Skip to content

Commit 34236ab

Browse files
committed
[FIX] auth_partner: Fix directory rights on token generation
1 parent 7e15fb1 commit 34236ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

auth_partner/models/auth_directory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def _send_mail_impl(self, type_or_template, auth_partner, **context):
147147
return f"Mail {template.name} sent to {auth_partner.login}"
148148

149149
def _generate_token(self, action, auth_partner, expiration_delta, key_salt=""):
150+
# We need to sudo here as secret_key is a protected field
151+
self = self.sudo()
150152
return jwt.encode(
151153
{
152154
"exp": datetime.now(tz=timezone.utc) + expiration_delta,

0 commit comments

Comments
 (0)