diff --git a/frontend/src/lib/i18n/locales/en-US.json b/frontend/src/lib/i18n/locales/en-US.json index 0a5a76c8..49b96659 100644 --- a/frontend/src/lib/i18n/locales/en-US.json +++ b/frontend/src/lib/i18n/locales/en-US.json @@ -80,5 +80,17 @@ "profileScopeDescription": "Allows the app to access your profile information.", "groupsScopeName": "Groups", "groupsScopeDescription": "Allows the app to access your group information.", - "backToLoginButton": "Back to login" + "backToLoginButton": "Back to login", + "phoneScopeName": "Phone", + "phoneScopeDescription": "Allows the app to access your phone number.", + "addressScopeName": "Address", + "addressScopeDescription": "Allows the app to access your address.", + "loginTailscaleTitle": "Continue with Tailscale", + "loginTailscaleDescription": "We detected that you are accessing Tinyauth from an authorized Tailscale device. Would you like to continue with your Tailscale connection?", + "loginTailscaleDeviceName": "Device name:", + "loginTailscaleSubmit": "Continue with Tailscale", + "loginTailscaleOtherMethod": "Login with another method", + "loginTailscaleSuccess": "Successfully authenticated with Tailscale.", + "loginTailscaleFail": "Failed to authenticate with Tailscale. Please try again or use another login method.", + "logoutTailscaleSubtitle": "You are currently logged in with Tailscale on your device {{deviceName}}. Click the button below to logout." } diff --git a/frontend/src/lib/i18n/locales/en.json b/frontend/src/lib/i18n/locales/en.json index dd39a6ce..49b96659 100644 --- a/frontend/src/lib/i18n/locales/en.json +++ b/frontend/src/lib/i18n/locales/en.json @@ -84,5 +84,13 @@ "phoneScopeName": "Phone", "phoneScopeDescription": "Allows the app to access your phone number.", "addressScopeName": "Address", - "addressScopeDescription": "Allows the app to access your address." + "addressScopeDescription": "Allows the app to access your address.", + "loginTailscaleTitle": "Continue with Tailscale", + "loginTailscaleDescription": "We detected that you are accessing Tinyauth from an authorized Tailscale device. Would you like to continue with your Tailscale connection?", + "loginTailscaleDeviceName": "Device name:", + "loginTailscaleSubmit": "Continue with Tailscale", + "loginTailscaleOtherMethod": "Login with another method", + "loginTailscaleSuccess": "Successfully authenticated with Tailscale.", + "loginTailscaleFail": "Failed to authenticate with Tailscale. Please try again or use another login method.", + "logoutTailscaleSubtitle": "You are currently logged in with Tailscale on your device {{deviceName}}. Click the button below to logout." } diff --git a/frontend/src/pages/login-page.tsx b/frontend/src/pages/login-page.tsx index bc94abfd..26538cf3 100644 --- a/frontend/src/pages/login-page.tsx +++ b/frontend/src/pages/login-page.tsx @@ -158,8 +158,8 @@ export const LoginPage = () => { mutationFn: () => axios.post("/api/user/tailscale"), mutationKey: ["tailscale"], onSuccess: () => { - toast.success("Logged in", { - description: t("Tailscale session confirmed"), + toast.success(t("loginSuccessTitle"), { + description: t("loginTailscaleSuccess"), }); redirectTimer.current = window.setTimeout(() => { @@ -173,8 +173,8 @@ export const LoginPage = () => { }, 500); }, onError: () => { - toast.error("Failed to login", { - description: "Failed to authenticate with Tailscale.", + toast.error(t("loginFailTitle"), { + description: t("loginTailscaleFail"), }); }, }); @@ -266,17 +266,15 @@ export const LoginPage = () => { - Tinyauth ยท Tailscale + {t("loginTailscaleTitle")}
- We detected that you are accessing Tinyauth from an authorized - Tailscale device. Would you like to continue with your Tailscale - credentials? + {t("loginTailscaleDescription")}
- Machine Name: {tailscale.nodeName} + {t("loginTailscaleDeviceName")} {tailscale.nodeName}
@@ -285,7 +283,7 @@ export const LoginPage = () => { onClick={() => tailscaleMutate()} loading={tailscaleIsPending} > - Continue with Tailscale + {t("loginTailscaleSubmit")} diff --git a/frontend/src/pages/logout-page.tsx b/frontend/src/pages/logout-page.tsx index 7f500d7e..bd1704c0 100644 --- a/frontend/src/pages/logout-page.tsx +++ b/frontend/src/pages/logout-page.tsx @@ -75,9 +75,17 @@ export const LogoutPage = () => { if (auth.providerId === "tailscale") { return ( - You are currently logged in with the Tailscale integration identified by - the {tailscale.nodeName} node. Click the button below to - log out. + , + }} + values={{ + deviceName: tailscale.nodeName, + }} + shouldUnescape={true} + /> ); } diff --git a/internal/bootstrap/app_bootstrap.go b/internal/bootstrap/app_bootstrap.go index 630413a4..b92dfe5c 100644 --- a/internal/bootstrap/app_bootstrap.go +++ b/internal/bootstrap/app_bootstrap.go @@ -396,7 +396,7 @@ func (app *BootstrapApp) serveUnix() error { } func (app *BootstrapApp) serveTailscale() error { - app.log.App.Info().Msgf("Starting Tailscale server on %s", app.services.tailscaleService.GetHostname()) + app.log.App.Info().Msgf("Starting Tailscale server on %s", fmt.Sprintf("https://%s", app.services.tailscaleService.GetHostname())) listener, err := app.services.tailscaleService.CreateListener()