Skip to content

Commit

Permalink
Merge pull request #508 from docat-org/feature/maintanace
Browse files Browse the repository at this point in the history
Feature/maintanace
  • Loading branch information
fliiiix authored May 3, 2023
2 parents 8bad98e + 7500bca commit b8bc85d
Show file tree
Hide file tree
Showing 5 changed files with 2,131 additions and 2,243 deletions.
2 changes: 1 addition & 1 deletion docat/docat/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def check_token_for_project(db, token, project) -> TokenStatus:
if result and token:
token_hash = calculate_token(token, bytes.fromhex(result[0]["salt"]))
if result[0]["token"] == token_hash:
return TokenStatus(True)
return TokenStatus(True, "Docat-Api-Key token is valid")
else:
return TokenStatus(False, f"Docat-Api-Key token is not valid for {project}")
else:
Expand Down
2 changes: 1 addition & 1 deletion docat/docat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@dataclass(frozen=True)
class TokenStatus:
valid: bool
reason: str | None = None
reason: str


class ApiResponse(BaseModel):
Expand Down
Loading

0 comments on commit b8bc85d

Please sign in to comment.