Skip to content

Commit

Permalink
Lock Slack Keys (#1338)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongsun96 committed Apr 16, 2024
1 parent 654c103 commit bd7e21a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/danswer/server/manage/slack_bot.py
Expand Up @@ -192,12 +192,15 @@ def list_slack_bot_configs(


@router.put("/admin/slack-bot/tokens")
def put_tokens(tokens: SlackBotTokens) -> None:
def put_tokens(
tokens: SlackBotTokens,
_: User | None = Depends(current_admin_user),
) -> None:
save_tokens(tokens=tokens)


@router.get("/admin/slack-bot/tokens")
def get_tokens() -> SlackBotTokens:
def get_tokens(_: User | None = Depends(current_admin_user)) -> SlackBotTokens:
try:
return fetch_tokens()
except ConfigNotFoundError:
Expand Down

0 comments on commit bd7e21a

Please sign in to comment.