From fee44fa1b22bfc6077a758d2cf82cc32840dadd5 Mon Sep 17 00:00:00 2001 From: ppanel-web Date: Sun, 8 Feb 2026 08:42:00 +0000 Subject: [PATCH] fix(auth): support OAuth callbacks with hash router (Fixes #9) --- apps/user/public/oauth/google/index.html | 28 +++++++++++++++++++ apps/user/public/oauth/telegram/index.html | 27 ++++++++++++++++++ apps/user/src/sections/auth/oauth-methods.tsx | 5 +++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 apps/user/public/oauth/google/index.html create mode 100644 apps/user/public/oauth/telegram/index.html diff --git a/apps/user/public/oauth/google/index.html b/apps/user/public/oauth/google/index.html new file mode 100644 index 0000000..2961fd0 --- /dev/null +++ b/apps/user/public/oauth/google/index.html @@ -0,0 +1,28 @@ + + + + + + OAuth Redirect + + + + + Redirecting… + + diff --git a/apps/user/public/oauth/telegram/index.html b/apps/user/public/oauth/telegram/index.html new file mode 100644 index 0000000..82deea9 --- /dev/null +++ b/apps/user/public/oauth/telegram/index.html @@ -0,0 +1,27 @@ + + + + + + OAuth Redirect + + + + + Redirecting… + + diff --git a/apps/user/src/sections/auth/oauth-methods.tsx b/apps/user/src/sections/auth/oauth-methods.tsx index 96548bd..b1e6595 100644 --- a/apps/user/src/sections/auth/oauth-methods.tsx +++ b/apps/user/src/sections/auth/oauth-methods.tsx @@ -35,7 +35,10 @@ export function OAuthMethods() { onClick={async () => { const { data } = await oAuthLogin({ method, - redirect: `${window.location.origin}/oauth/${method}`, + // OAuth providers disallow URL fragments (#) in redirect URIs. + // Use a real path (with trailing slash so static hosting can serve /oauth//index.html) + // which then bridges into our hash-router at /#/oauth/. + redirect: `${window.location.origin}/oauth/${method}/`, }); if (data.data?.redirect) { window.location.href = data.data?.redirect;