mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-15 16:50:18 +00:00
i18n: i18n tailscale frontend features
This commit is contained in:
@@ -80,5 +80,17 @@
|
|||||||
"profileScopeDescription": "Allows the app to access your profile information.",
|
"profileScopeDescription": "Allows the app to access your profile information.",
|
||||||
"groupsScopeName": "Groups",
|
"groupsScopeName": "Groups",
|
||||||
"groupsScopeDescription": "Allows the app to access your group information.",
|
"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 <code>{{deviceName}}</code>. Click the button below to logout."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,5 +84,13 @@
|
|||||||
"phoneScopeName": "Phone",
|
"phoneScopeName": "Phone",
|
||||||
"phoneScopeDescription": "Allows the app to access your phone number.",
|
"phoneScopeDescription": "Allows the app to access your phone number.",
|
||||||
"addressScopeName": "Address",
|
"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 <code>{{deviceName}}</code>. Click the button below to logout."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ export const LoginPage = () => {
|
|||||||
mutationFn: () => axios.post("/api/user/tailscale"),
|
mutationFn: () => axios.post("/api/user/tailscale"),
|
||||||
mutationKey: ["tailscale"],
|
mutationKey: ["tailscale"],
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast.success("Logged in", {
|
toast.success(t("loginSuccessTitle"), {
|
||||||
description: t("Tailscale session confirmed"),
|
description: t("loginTailscaleSuccess"),
|
||||||
});
|
});
|
||||||
|
|
||||||
redirectTimer.current = window.setTimeout(() => {
|
redirectTimer.current = window.setTimeout(() => {
|
||||||
@@ -173,8 +173,8 @@ export const LoginPage = () => {
|
|||||||
}, 500);
|
}, 500);
|
||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
toast.error("Failed to login", {
|
toast.error(t("loginFailTitle"), {
|
||||||
description: "Failed to authenticate with Tailscale.",
|
description: t("loginTailscaleFail"),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -266,17 +266,15 @@ export const LoginPage = () => {
|
|||||||
<CardHeader className="gap-3">
|
<CardHeader className="gap-3">
|
||||||
<TailscaleIcon className="mx-auto h-8 w-8" />
|
<TailscaleIcon className="mx-auto h-8 w-8" />
|
||||||
<CardTitle className="text-center text-xl">
|
<CardTitle className="text-center text-xl">
|
||||||
Tinyauth · Tailscale
|
{t("loginTailscaleTitle")}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="flex flex-col gap-4">
|
<CardContent className="flex flex-col gap-4">
|
||||||
<div className="text-muted-foreground text-sm">
|
<div className="text-muted-foreground text-sm">
|
||||||
We detected that you are accessing Tinyauth from an authorized
|
{t("loginTailscaleDescription")}
|
||||||
Tailscale device. Would you like to continue with your Tailscale
|
|
||||||
credentials?
|
|
||||||
</div>
|
</div>
|
||||||
<div className="text-muted-foreground text-sm">
|
<div className="text-muted-foreground text-sm">
|
||||||
Machine Name: <code>{tailscale.nodeName}</code>
|
{t("loginTailscaleDeviceName")} <code>{tailscale.nodeName}</code>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardFooter className="flex flex-col items-stretch gap-3">
|
<CardFooter className="flex flex-col items-stretch gap-3">
|
||||||
@@ -285,7 +283,7 @@ export const LoginPage = () => {
|
|||||||
onClick={() => tailscaleMutate()}
|
onClick={() => tailscaleMutate()}
|
||||||
loading={tailscaleIsPending}
|
loading={tailscaleIsPending}
|
||||||
>
|
>
|
||||||
Continue with Tailscale
|
{t("loginTailscaleSubmit")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className="w-full"
|
className="w-full"
|
||||||
@@ -293,7 +291,7 @@ export const LoginPage = () => {
|
|||||||
onClick={() => setUseTailscale(false)}
|
onClick={() => setUseTailscale(false)}
|
||||||
disabled={tailscaleIsPending}
|
disabled={tailscaleIsPending}
|
||||||
>
|
>
|
||||||
Use other login method
|
{t("loginTailscaleOtherMethod")}
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -75,9 +75,17 @@ export const LogoutPage = () => {
|
|||||||
if (auth.providerId === "tailscale") {
|
if (auth.providerId === "tailscale") {
|
||||||
return (
|
return (
|
||||||
<LogoutLayout logoutMutation={logoutMutation}>
|
<LogoutLayout logoutMutation={logoutMutation}>
|
||||||
You are currently logged in with the Tailscale integration identified by
|
<Trans
|
||||||
the <code>{tailscale.nodeName}</code> node. Click the button below to
|
i18nKey="logoutTailscaleSubtitle"
|
||||||
log out.
|
t={t}
|
||||||
|
components={{
|
||||||
|
code: <code />,
|
||||||
|
}}
|
||||||
|
values={{
|
||||||
|
deviceName: tailscale.nodeName,
|
||||||
|
}}
|
||||||
|
shouldUnescape={true}
|
||||||
|
/>
|
||||||
</LogoutLayout>
|
</LogoutLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ func (app *BootstrapApp) serveUnix() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (app *BootstrapApp) serveTailscale() 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()
|
listener, err := app.services.tailscaleService.CreateListener()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user