~tsileo/microblog.pub-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
4 3

[PATCH microblog.pub 0/1] If already logged in, redirect away from /admin/login to /admin/strea

Details
Message ID
<166218924856.21873.10838716480709166086-0@git.sr.ht>
DKIM signature
missing
Download raw message
I don't know if you agree, but when logged in, if you click 'Admin' in
the footer, it feels weird to see the password prompt alongside the
logged-in nav. Added a simple redirect away for that edge case.

Miguel Jacq (1):
  If already logged in, redirect away from /admin/login to /admin/stream

 app/admin.py | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.34.4

[PATCH microblog.pub 1/1] If already logged in, redirect away from /admin/login to /admin/stream

Details
Message ID
<166218924856.21873.10838716480709166086-1@git.sr.ht>
In-Reply-To
<166218924856.21873.10838716480709166086-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +4 -0
From: Miguel Jacq <mig@mig5.net>

---
 app/admin.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/admin.py b/app/admin.py
index d2e2acd..16dffdf 100644
--- a/app/admin.py
+++ b/app/admin.py
@@ -1107,8 +1107,12 @@ async def admin_actions_vote(
@unauthenticated_router.get("/login")
async def login(
    request: Request,
    session: str = Cookie(None),
    db_session: AsyncSession = Depends(get_db_session),
) -> templates.TemplateResponse:
    loaded_session = session_serializer.loads(session, max_age=3600 * 12)
    if loaded_session.get("is_logged_in"):
        return RedirectResponse("/admin/stream", status_code=302)
    return await templates.render_template(
        db_session,
        request,
-- 
2.34.4

[microblog.pub/patches/.build.yml] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CMMKZOZ46L30.DKD4EPSPD8VP@cirno>
In-Reply-To
<166218924856.21873.10838716480709166086-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
microblog.pub/patches/.build.yml: FAILED in 3m40s

[If already logged in, redirect away from /admin/login to /admin/strea][0] from [~mig5][1]

[0]: https://lists.sr.ht/~tsileo/microblog.pub-devel/patches/35091
[1]: mig@mig5.net

✗ #837474 FAILED microblog.pub/patches/.build.yml https://builds.sr.ht/~tsileo/job/837474
Details
Message ID
<6fea967b-9390-4d53-a9cb-bbc89e588b80@www.fastmail.com>
In-Reply-To
<166218924856.21873.10838716480709166086-0@git.sr.ht> (view parent)
DKIM signature
pass
Download raw message
Hey, I agree with the change, but it's bit more tricky than what's in your patch.

The cookie can be `None` here:

```
session: str = Cookie(None),
```
I will implement a fix for this using a different strategy.

Thanks!
Details
Message ID
<c14c3998-96f1-4dc4-b909-d379424cfd1f@www.fastmail.com>
In-Reply-To
<6fea967b-9390-4d53-a9cb-bbc89e588b80@www.fastmail.com> (view parent)
DKIM signature
pass
Download raw message
Fixed via https://git.sr.ht/~tsileo/microblog.pub/commit/e454e8fe843ce2309ef7a16d0f8a7d1ca8600958
Reply to thread Export thread (mbox)