Skip to content

Commit

Permalink
[FIX] auth_partner: Fix directory rights on token generation
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Nov 7, 2024
1 parent b71a156 commit cdc1980
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions auth_partner/models/auth_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def _send_mail_impl(self, type_or_template, auth_partner, **context):
return f"Mail {template.name} sent to {auth_partner.login}"

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

0 comments on commit cdc1980

Please sign in to comment.