Skip to content

Commit

Permalink
Shorten docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit committed Nov 13, 2023
1 parent 5416307 commit 17759b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/nav/models/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,17 @@ def expire(self):

@classmethod
def generate_access_token(cls, token_data: Dict[str, Any] = {}) -> str:
"""Generates and returns an access token in JWT format. Will use `token_data` as a basis
for the new token, but certain claims will be overridden
"""Generates and returns an access token in JWT format.
Will use `token_data` as a basis for the new token,
but certain claims will be overridden.
"""
return cls._generate_token(token_data, cls.ACCESS_EXPIRE_DELTA, "access_token")

@classmethod
def generate_refresh_token(cls, token_data: Dict[str, Any] = {}) -> str:
"""Generates and returns a refresh token in JWT format. Will use `token_data` as a basis
for the new token, but certain claims will be overridden
"""Generates and returns a refresh token in JWT format.
Will use `token_data` as a basis for the new token,
but certain claims will be overridden.
"""
return cls._generate_token(
token_data, cls.REFRESH_EXPIRE_DELTA, "refresh_token"
Expand Down

0 comments on commit 17759b3

Please sign in to comment.