Skip to content

Commit

Permalink
feat(configure): explicit page to link obsidian
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Feb 13, 2024
1 parent a184a4a commit ac7d455
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions backend/routes/login/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ async def configure_obsidian(
config: Settings = Depends(get_config),
):
access_token = request.session["access_token"]
return RedirectResponse(
url=f"obsidian:https://relay.md:access-token?token={access_token}&username={user.username}&api_url={config.API_URI}"
)
redirect_url = f"obsidian:https://relay.md:access-token?token={access_token}&username={user.username}&api_url={config.API_URI}"
return templates.TemplateResponse("configure-obsidian.pug", context=locals())


@router.post("/onboarding/check-username", response_class=PlainTextResponse)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions backend/utils/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

def get_next_url(req: Request) -> Optional[str]:
if "next" not in req.session:
return
return None
try:
return req.session["next"].pop()
except IndexError:
return
return None


def add_next_url(req: Request, url: Optional[str]):
if not url:
return
return None
if "next" not in req.session:
req.session["next"] = []
# no duplicates in next-stack
Expand Down

0 comments on commit ac7d455

Please sign in to comment.