From 47bc534b1f3dcafea4206b1c2bc7af0f29d015ff Mon Sep 17 00:00:00 2001 From: naskya <m@naskya.net> Date: Thu, 7 Mar 2024 11:13:21 +0900 Subject: [PATCH] chore (client, locale): log in/out -> sign in/out --- locales/en-US.yml | 14 +++++++------- packages/client/src/account.ts | 10 +++++----- packages/client/src/components/MkSignin.vue | 4 ++-- packages/client/src/components/MkSignup.vue | 4 ++-- packages/client/src/init.ts | 8 ++++---- packages/client/src/pages/auth.vue | 4 ++-- packages/client/src/pages/miauth.vue | 4 ++-- packages/client/src/pages/settings/accounts.vue | 4 ++-- .../client/src/pages/settings/delete-account.vue | 4 ++-- packages/client/src/pages/settings/index.vue | 4 ++-- packages/client/src/pages/signup-complete.vue | 4 ++-- packages/client/src/pages/welcome.setup.vue | 4 ++-- packages/client/src/ui/_common_/sw-inject.ts | 4 ++-- 13 files changed, 36 insertions(+), 36 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index c7512bb941..35e14ff9b3 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -462,7 +462,7 @@ securityKeyName: "Key name" registerSecurityKey: "Register a security key" lastUsed: "Last used" unregister: "Unregister" -passwordLessLogin: "Password-less login" +passwordLessLogin: "Password-less sign in" resetPassword: "Reset password" newPasswordIs: "The new password is \"{password}\"" reduceUiAnimation: "Reduce UI animations" @@ -527,7 +527,7 @@ disableDrawer: "Don't use drawer-style menus" youHaveNoGroups: "You have no groups" joinOrCreateGroup: "Get invited to a group or create your own." noHistory: "No history available" -signinHistory: "Login history" +signinHistory: "Sign in history" disableAnimatedMfm: "Disable MFM with animation" doing: "Processing..." category: "Category" @@ -717,8 +717,8 @@ useGlobalSetting: "Use global settings" useGlobalSettingDesc: "If turned on, your account's notification settings will be used. If turned off, individual configurations can be made." other: "Other" -regenerateLoginToken: "Regenerate login token" -regenerateLoginTokenDescription: "Regenerates the token used internally during login. +regenerateLoginToken: "Regenerate sign in token" +regenerateLoginTokenDescription: "Regenerates the token used internally during sign in. Normally this action is not necessary. If regenerated, all devices will be logged out." setMultipleBySeparatingWithSpace: "Separate multiple entries with spaces." @@ -1001,7 +1001,7 @@ check: "Check" driveCapOverrideLabel: "Change the drive capacity for this user" driveCapOverrideCaption: "Reset the capacity to default by inputting a value of 0 or lower." -requireAdminForView: "You must log in with an administrator account to view this." +requireAdminForView: "You must sign in with an administrator account to view this." isSystemAccount: "This account is created and automatically operated by the system. Please do not moderate, edit, delete, or otherwise tamper with this account, or it may break your server." @@ -1011,7 +1011,7 @@ document: "Documentation" numberOfPageCache: "Number of cached pages" numberOfPageCacheDescription: "Increasing this number will improve convenience for users but cause more server load as well as more memory to be used." -logoutConfirm: "Really log out?" +logoutConfirm: "Really sign out?" lastActiveDate: "Last used at" statusbar: "Status bar" pleaseSelect: "Select an option" @@ -1627,7 +1627,7 @@ _2fa: step2Url: "You can also enter this URL if you're using a desktop program:" step3Title: "Enter an authentication code" step3: "Enter the token provided by your app to finish setup." - step4: "From now on, any future login attempts will ask for such a login token." + step4: "From now on, any future sign in attempts will ask for such a token." securityKeyNotSupported: "Your browser does not support security keys." securityKeyInfo: "Besides fingerprint or PIN authentication, you can also setup authentication via hardware security keys that support FIDO2 to further secure diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 82a5d30aab..5bdb9ba048 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -11,7 +11,7 @@ import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; export type Account = entities.MeDetailed; -export async function signout() { +export async function signOut() { waiting(); localStorage.removeItem("account"); @@ -47,7 +47,7 @@ export async function signout() { document.cookie = "igi=; path=/"; - if (accounts.length > 0) login(accounts[0].token); + if (accounts.length > 0) signIn(accounts[0].token); else unisonReload("/"); } @@ -89,7 +89,7 @@ function fetchAccount(token: string): Promise<Account> { if (res.error) { if (res.error.id === "a8c724b3-6e9c-4b46-b1a8-bc3ed6258370") { showSuspendedDialog(); - signout(); + signOut(); } else { alert({ type: "error", @@ -126,7 +126,7 @@ export async function refreshAccount() { return updateAccount(accountData); } -export async function login(token: Account["token"], redirect?: string) { +export async function signIn(token: Account["token"], redirect?: string) { waiting(); if (_DEV_) console.log("logging as token ", token); const newAccount = await fetchAccount(token); @@ -190,7 +190,7 @@ export async function openAccountMenu( } function switchAccountWithToken(token: string) { - login(token); + signIn(token); } const storedAccounts = await getAccounts().then((accounts) => diff --git a/packages/client/src/components/MkSignin.vue b/packages/client/src/components/MkSignin.vue index 7fb2e6f16a..53a593fb13 100644 --- a/packages/client/src/components/MkSignin.vue +++ b/packages/client/src/components/MkSignin.vue @@ -142,7 +142,7 @@ import MkInfo from "@/components/MkInfo.vue"; import { host as configHost } from "@/config"; import { byteify, hexify } from "@/scripts/2fa"; import * as os from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { i18n } from "@/i18n"; import icon from "@/scripts/icon"; @@ -195,7 +195,7 @@ function onUsernameChange() { function onLogin(res) { if (props.autoSet) { - return login(res.i); + return signIn(res.i); } } diff --git a/packages/client/src/components/MkSignup.vue b/packages/client/src/components/MkSignup.vue index 3b4cd48890..6de17b2d48 100644 --- a/packages/client/src/components/MkSignup.vue +++ b/packages/client/src/components/MkSignup.vue @@ -281,7 +281,7 @@ import MkSwitch from "./form/switch.vue"; import MkCaptcha from "@/components/MkCaptcha.vue"; import * as config from "@/config"; import * as os from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { instance } from "@/instance"; import { i18n } from "@/i18n"; import icon from "@/scripts/icon"; @@ -470,7 +470,7 @@ function onSubmit(): void { emit("signup", res); if (props.autoSet) { - login(res.i); + signIn(res.i); } }); } diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 0dd71a6cdc..8022c60896 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -32,7 +32,7 @@ import { } from "vue"; import { set } from "@/scripts/idb-proxy"; -import { login, refreshAccount, signout, updateAccount } from "@/account"; +import { signIn, refreshAccount, signOut, updateAccount } from "@/account"; import components from "@/components"; import { lang, ui, version } from "@/config"; import directives from "@/directives"; @@ -133,7 +133,7 @@ function checkForSplash() { if (!me || me.id !== loginId) { const account = await getAccountFromId(loginId); if (account) { - await login(account.token, target); + await signIn(account.token, target); } } @@ -164,7 +164,7 @@ function checkForSplash() { try { document.body.innerHTML = "<div>Please wait...</div>"; - await login(i); + await signIn(i); } catch (err) { // Render the error screen // TODO: ちゃんとしたコンポーネントをレンダリングする(v10とかのトラブルシューティングゲーム付きのやつみたいな) @@ -542,7 +542,7 @@ function checkForSplash() { // トークンが再生成されたとき // このままではMisskeyが利用できないので強制的にサインアウトさせる main.on("myTokenRegenerated", () => { - signout(); + signOut(); }); } diff --git a/packages/client/src/pages/auth.vue b/packages/client/src/pages/auth.vue index 1e53727449..8a600f7d72 100644 --- a/packages/client/src/pages/auth.vue +++ b/packages/client/src/pages/auth.vue @@ -51,7 +51,7 @@ import XForm from "./auth.form.vue"; import MkSignin from "@/components/MkSignin.vue"; import MkKeyValue from "@/components/MkKeyValue.vue"; import * as os from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { isSignedIn } from "@/me"; import { i18n } from "@/i18n"; @@ -132,6 +132,6 @@ const accepted = () => { }; const onLogin = (res) => { - login(res.i); + signIn(res.i); }; </script> diff --git a/packages/client/src/pages/miauth.vue b/packages/client/src/pages/miauth.vue index a706adada3..d8fb31ab92 100644 --- a/packages/client/src/pages/miauth.vue +++ b/packages/client/src/pages/miauth.vue @@ -82,7 +82,7 @@ import { ref } from "vue"; import MkSignin from "@/components/MkSignin.vue"; import MkButton from "@/components/MkButton.vue"; import * as os from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { me } from "@/me"; import { appendQuery, query } from "@/scripts/url"; import { i18n } from "@/i18n"; @@ -136,7 +136,7 @@ function deny(): void { } function onLogin(res): void { - login(res.i); + signIn(res.i); } </script> diff --git a/packages/client/src/pages/settings/accounts.vue b/packages/client/src/pages/settings/accounts.vue index ed9e9a3954..00e8050ee3 100644 --- a/packages/client/src/pages/settings/accounts.vue +++ b/packages/client/src/pages/settings/accounts.vue @@ -37,7 +37,7 @@ import { removeAccount as _removeAccount, addAccount as addAccounts, getAccounts, - login, + signIn, } from "@/account"; import { me } from "@/me"; import { i18n } from "@/i18n"; @@ -142,7 +142,7 @@ async function switchAccount(account: any) { } function switchAccountWithToken(token: string) { - login(token); + signIn(token); } definePageMetadata({ diff --git a/packages/client/src/pages/settings/delete-account.vue b/packages/client/src/pages/settings/delete-account.vue index bc367742f8..9d697da024 100644 --- a/packages/client/src/pages/settings/delete-account.vue +++ b/packages/client/src/pages/settings/delete-account.vue @@ -23,7 +23,7 @@ import FormInfo from "@/components/MkInfo.vue"; import FormButton from "@/components/MkButton.vue"; import * as os from "@/os"; -import { signout } from "@/account"; +import { signOut } from "@/account"; import { i18n } from "@/i18n"; import { definePageMetadata } from "@/scripts/page-metadata"; import icon from "@/scripts/icon"; @@ -51,7 +51,7 @@ async function deleteAccount() { title: i18n.ts._accountDelete.started, }); - await signout(); + await signOut(); } definePageMetadata({ diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index d1b6e80555..4954219ecb 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -45,7 +45,7 @@ import { computed, onActivated, onMounted, onUnmounted, ref, watch } from "vue"; import { i18n } from "@/i18n"; import MkInfo from "@/components/MkInfo.vue"; import MkSuperMenu from "@/components/MkSuperMenu.vue"; -import { signout } from "@/account"; +import { signOut } from "@/account"; import { me } from "@/me"; import { unisonReload } from "@/scripts/unison-reload"; import { instance } from "@/instance"; @@ -248,7 +248,7 @@ const menuDef = computed(() => [ text: i18n.ts.logoutConfirm, }); if (canceled) return; - signout(); + signOut(); }, danger: true, }, diff --git a/packages/client/src/pages/signup-complete.vue b/packages/client/src/pages/signup-complete.vue index de6f40ffb3..7bd75adb4e 100644 --- a/packages/client/src/pages/signup-complete.vue +++ b/packages/client/src/pages/signup-complete.vue @@ -7,7 +7,7 @@ <script lang="ts" setup> import { onMounted } from "vue"; import * as os from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { i18n } from "@/i18n"; import { definePageMetadata } from "@/scripts/page-metadata"; import icon from "@/scripts/icon"; @@ -24,7 +24,7 @@ onMounted(async () => { const res = await os.apiWithDialog("signup-pending", { code: props.code, }); - login(res.i, "/"); + signIn(res.i, "/"); }); definePageMetadata({ diff --git a/packages/client/src/pages/welcome.setup.vue b/packages/client/src/pages/welcome.setup.vue index b4a9137a3d..199c48d453 100644 --- a/packages/client/src/pages/welcome.setup.vue +++ b/packages/client/src/pages/welcome.setup.vue @@ -46,7 +46,7 @@ import MkButton from "@/components/MkButton.vue"; import MkInput from "@/components/form/input.vue"; import { host } from "@/config"; import * as os from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { i18n } from "@/i18n"; import icon from "@/scripts/icon"; @@ -71,7 +71,7 @@ function submit() { }); } }); - return login(res?.token); + return signIn(res?.token); }) .catch(() => { submitting.value = false; diff --git a/packages/client/src/ui/_common_/sw-inject.ts b/packages/client/src/ui/_common_/sw-inject.ts index d042089218..17974674ac 100644 --- a/packages/client/src/ui/_common_/sw-inject.ts +++ b/packages/client/src/ui/_common_/sw-inject.ts @@ -1,5 +1,5 @@ import { post } from "@/os"; -import { login } from "@/account"; +import { signIn } from "@/account"; import { me } from "@/me"; import { getAccountFromId } from "@/scripts/get-account-from-id"; import { mainRouter } from "@/router"; @@ -15,7 +15,7 @@ export function swInject() { if (ev.data.loginId !== me?.id) { return getAccountFromId(ev.data.loginId).then((account) => { if (!account) return; - return login(account.token, ev.data.url); + return signIn(account.token, ev.data.url); }); }