From 6ed5cdbff398328d03d59e7c08c1b5d289ce9fe4 Mon Sep 17 00:00:00 2001 From: HeavenVR Date: Mon, 30 Nov 2026 22:15:42 +0100 Subject: [PATCH 1/9] feat: activation credential check, email-change verify behind login, pending OAuth signup notice Activate asks for the account's password or a linked provider sign-in when the link is opened outside the signup browser. Verify-email moves into the signed-in app and handles an address already in use. The OAuth create page explains a pending signup when opened with ?pending=1. --- messages/en.json | 8 ++ src/lib/api/next/account.ts | 84 +++++++++++++++++ src/lib/api/next/oauth.ts | 11 ++- src/lib/components/auth/oauth-buttons.svelte | 8 +- src/routes/(app)/verify-email/+page.svelte | 65 +++++++++++++ src/routes/(auth)/activate/+page.svelte | 92 +++++++++++++++++-- .../oauth/[provider]/create/+page.svelte | 13 +++ src/routes/(auth)/verify-email/+page.svelte | 56 ----------- 8 files changed, 268 insertions(+), 69 deletions(-) create mode 100644 src/routes/(app)/verify-email/+page.svelte delete mode 100644 src/routes/(auth)/verify-email/+page.svelte diff --git a/messages/en.json b/messages/en.json index 73f23f17..89e8ed3e 100644 --- a/messages/en.json +++ b/messages/en.json @@ -73,6 +73,12 @@ "auth_activate_missing_token": "Missing activation token", "auth_activate_continue": "Continue to login", "auth_activate_toast_success": "Account activated", + "auth_activate_credential_required": "To finish activating this account, confirm it is yours.", + "auth_activate_credential_password": "Enter the password you chose when signing up.", + "auth_activate_credential_oauth": "Sign in with the provider you signed up with.", + "auth_activate_credential_not_yours": "Didn't create this account? You can ignore this email. Nothing is activated.", + "auth_activate_password_invalid": "That password is incorrect", + "auth_activate_submit": "Activate account", "auth_forgot_breadcrumb": "Forgot Password", "auth_forgot_title": "Forgot Password", @@ -103,6 +109,7 @@ "auth_oauth_create_breadcrumb": "Sign Up With {{provider}}", "auth_oauth_create_title": "Sign Up With {{provider}}", "auth_oauth_create_description": "Complete your account details", + "auth_oauth_create_pending": "You already signed up with this account and it is waiting for activation. We sent the activation email again. Used the wrong address? Correct it below and submit to get a new email.", "auth_oauth_create_username_label": "Username", "auth_oauth_create_username_placeholder": "Username", "auth_oauth_create_email_label": "Email", @@ -162,6 +169,7 @@ "auth_verify_missing_token": "Missing verification token", "auth_verify_continue": "Continue to login", "auth_verify_toast_success": "Email verified", + "auth_verify_in_use": "This email address is already in use", "common_cancel": "Cancel", "common_delete": "Delete", diff --git a/src/lib/api/next/account.ts b/src/lib/api/next/account.ts index bc47e717..452bd4c9 100644 --- a/src/lib/api/next/account.ts +++ b/src/lib/api/next/account.ts @@ -44,3 +44,87 @@ export async function ResendActivationEmail(): Promise { const body: unknown = await res.json().catch(() => undefined); throw new ResponseError(res, `Unexpected status ${res.status} for POST ${url}`, body); } + +export type VerifyEmailChangeResult = 'verified' | 'invalid' | 'in-use'; + +/** + * Confirms a pending email change. The API only accepts the token from a signed-in session of the account + * that requested the change, so this is only called from the signed-in part of the app. + */ +export async function VerifyEmailChange(token: string): Promise { + const url = getBackendURL('1/account/email-change/verify'); + url.searchParams.set('token', token); + + const res = await fetch(url, { + method: 'POST', + headers: { accept: 'application/json' }, + credentials: 'include', + redirect: 'error', + }); + + if (res.ok) return 'verified'; + if (res.status === 400) return 'invalid'; + if (res.status === 409) return 'in-use'; + + const body: unknown = await res.json().catch(() => undefined); + throw new ResponseError(res, `Unexpected status ${res.status} for POST ${url}`, body); +} + +export type ActivateAccountResult = + | { status: 'activated' } + | { status: 'invalid' } + | { + /** + * The link is valid, but this is not the browser that signed up, so the API also wants proof the + * account is the visitor's: its password, or a sign-in with one of the linked providers. + */ + status: 'credential-required'; + hasPassword: boolean; + oauthProviders: string[]; + passwordInvalid: boolean; + }; + +/** + * Activates the account an emailed activation token belongs to. In the browser that signed up the token is + * enough (the API recognizes it by a cookie); anywhere else the API answers `credential-required` first. + */ +export async function ActivateAccount( + token: string, + password?: string +): Promise { + const url = getBackendURL('1/account/activate'); + url.searchParams.set('token', token); + + const res = await fetch(url, { + method: 'POST', + headers: { 'content-type': 'application/json', accept: 'application/json' }, + body: JSON.stringify(password ? { password } : {}), + credentials: 'include', + redirect: 'error', + }); + + if (res.ok) return { status: 'activated' }; + if (res.status === 400) return { status: 'invalid' }; + + const body: unknown = await res.json().catch(() => undefined); + if ( + res.status === 403 && + isRecord(body) && + body.type === 'Account.Activation.CredentialRequired' + ) { + return { + status: 'credential-required', + hasPassword: body.hasPassword === true, + oauthProviders: Array.isArray(body.oauthProviders) + ? body.oauthProviders.filter((p): p is string => typeof p === 'string') + : [], + passwordInvalid: body.passwordInvalid === true, + }; + } + + throw new ResponseError(res, `Unexpected status ${res.status} for POST ${url}`, body); +} + +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null; +} diff --git a/src/lib/api/next/oauth.ts b/src/lib/api/next/oauth.ts index deda81a0..191cc5fb 100644 --- a/src/lib/api/next/oauth.ts +++ b/src/lib/api/next/oauth.ts @@ -3,10 +3,19 @@ import { GetJson, PostJson } from './base'; import type { LoginOkResponse, OAuthFinalizeRequest, OAuthSignupData } from './models'; import { TransformLoginOkResponse, TransformOAuthSignupData } from './transformers'; -export function GetOAuthAuthorizeUrl(provider: string, flow: 'LoginOrCreate' | 'Link'): string { +/** + * @param activationToken Token from the activation email. Signing in with the provider linked to a not yet + * activated account then activates it. + */ +export function GetOAuthAuthorizeUrl( + provider: string, + flow: 'LoginOrCreate' | 'Link', + activationToken?: string +): string { const url = getBackendURL(`1/oauth/${encodeURIComponent(provider)}/authorize`); url.searchParams.set('flow', flow); + if (activationToken) url.searchParams.set('activationToken', activationToken); return url.href; } diff --git a/src/lib/components/auth/oauth-buttons.svelte b/src/lib/components/auth/oauth-buttons.svelte index d286d8de..b01c2d7e 100644 --- a/src/lib/components/auth/oauth-buttons.svelte +++ b/src/lib/components/auth/oauth-buttons.svelte @@ -15,13 +15,17 @@ import { GetOAuthAuthorizeUrl } from '#lib/api/next/oauth.js'; import { LogIn } from '@lucide/svelte'; - let { mode = 'login', providers }: { mode?: 'login' | 'signup'; providers: string[] } = $props(); + let { + mode = 'login', + providers, + activationToken, + }: { mode?: 'login' | 'signup'; providers: string[]; activationToken?: string } = $props(); {#each providers as provider (provider)} {@const detail = providerDetails[provider]} -
+ + {:else if status === 'credential'} + + {#if oauthProviders.length > 0} +

{m.auth_activate_credential_oauth()}

+ + + {/if} + {#if hasPassword} + +

{m.auth_activate_credential_password()}

+ + {#if passwordInvalid} + + {/if} + + + {/if} +

+ {m.auth_activate_credential_not_yours()} +

+
{/if} diff --git a/src/routes/(auth)/oauth/[provider]/create/+page.svelte b/src/routes/(auth)/oauth/[provider]/create/+page.svelte index 11c353f5..2169f9ec 100644 --- a/src/routes/(auth)/oauth/[provider]/create/+page.svelte +++ b/src/routes/(auth)/oauth/[provider]/create/+page.svelte @@ -11,6 +11,7 @@ import { handleApiError } from '#lib/errorhandling/apiErrorHandling.js'; import { registerBreadcrumbs } from '#lib/state/breadcrumbs-state.svelte.js'; import { userState } from '#lib/state/user-state.svelte.js'; + import { consumeSearchParam } from '#lib/utils/url.js'; import { onMount } from 'svelte'; import { m } from '#lib/paraglide/messages.js'; import { ParaglideMessage } from '@inlang/paraglide-js-svelte'; @@ -29,6 +30,13 @@ let canSubmit = $derived(usernameValid && emailValid); + // Set when this provider account already started a signup that was never activated. Submitting the + // form again then corrects that pending signup (typically a mistyped email) rather than failing. + let pending = $state(false); + consumeSearchParam('pending', () => { + pending = true; + }); + async function handleSubmission(e: SubmitEvent) { e.preventDefault(); @@ -100,6 +108,11 @@ {m.auth_oauth_create_description()} + {#if pending} +

+ {m.auth_oauth_create_pending()} +

+ {/if}
- import { browser } from '$app/env'; - import { resolve } from '$app/paths'; - import { page } from '$app/state'; - import { accountEmailVerify } from '#lib/api/index.js'; - import { Button } from '@openshock/svelte-core/components/ui/button'; - import * as Card from '@openshock/svelte-core/components/ui/card'; - import { handleApiError } from '#lib/errorhandling/apiErrorHandling.js'; - import { registerBreadcrumbs } from '#lib/state/breadcrumbs-state.svelte.js'; - import { onMount } from 'svelte'; - import { toast } from 'svelte-sonner'; - import { m } from '#lib/paraglide/messages.js'; - - registerBreadcrumbs(() => [{ label: m.auth_verify_breadcrumb() }]); - - let token = browser ? page.url.searchParams.get('token') : null; - - let status = $state<'verifying' | 'success' | 'failed' | 'missing'>( - token ? 'verifying' : 'missing' - ); - - onMount(() => { - if (!token) return; - accountEmailVerify({ query: { token } }) - .then(() => { - status = 'success'; - toast.success(m.auth_verify_toast_success()); - }) - .catch(async (e: unknown) => { - status = 'failed'; - await handleApiError(e); - }); - }); - - - - -

{m.auth_verify_title()}

- - {#if status === 'verifying'} - {m.auth_verify_verifying()} - {:else if status === 'success'} - {m.auth_verify_success()} - {:else if status === 'failed'} - {m.auth_verify_failed()} - {:else} - {m.auth_verify_missing_token()} - {/if} - -
- {#if status === 'success'} - - - - {/if} -
From a11bcc5cd812b036185b10ad1bf8a04f1afb66e0 Mon Sep 17 00:00:00 2001 From: HeavenVR Date: Mon, 30 Nov 2026 22:25:30 +0100 Subject: [PATCH 2/9] feat: add OAuth.Connection.LastLoginMethod problem type --- messages/de.json | 2 ++ messages/en.json | 2 ++ messages/es.json | 2 ++ messages/et.json | 2 ++ messages/fi.json | 2 ++ messages/fr.json | 2 ++ messages/ja.json | 2 ++ messages/nb.json | 2 ++ messages/nl.json | 2 ++ messages/sv.json | 2 ++ messages/uk.json | 2 ++ messages/uwu.json | 2 ++ messages/zh-Hans.json | 2 ++ messages/zh-Hant.json | 2 ++ src/lib/errorhandling/problemMessages.ts | 4 ++++ src/lib/errorhandling/problemTypes.ts | 4 ++++ 16 files changed, 36 insertions(+) diff --git a/messages/de.json b/messages/de.json index e5b81100..3b64954a 100644 --- a/messages/de.json +++ b/messages/de.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Ungültiger Benutzername oder ungültiges Passwort", "problem_login_invalid_domain_title": "Die Anmeldung von dieser Adresse ist nicht erlaubt", "problem_o_auth_connection_already_exists_title": "Dein Konto ist bereits mit diesem Anbieter verbunden", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Dieses externe Konto ist bereits mit einem anderen Benutzer verknüpft", "problem_o_auth_flow_anonymous_only_title": "Du bist bereits angemeldet", "problem_o_auth_flow_mismatch_title": "Der Anmeldeversuch stimmt nicht überein", diff --git a/messages/en.json b/messages/en.json index 89e8ed3e..e35a0868 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1070,6 +1070,8 @@ "problem_login_invalid_credentials_title": "Invalid username or password", "problem_login_invalid_domain_title": "Logging in from this address is not allowed", "problem_o_auth_connection_already_exists_title": "Your account is already connected to this provider", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "This external account is already linked to another user", "problem_o_auth_flow_anonymous_only_title": "You are already signed in", "problem_o_auth_flow_mismatch_title": "Sign-in attempt does not match", diff --git a/messages/es.json b/messages/es.json index f6ef677d..633c410b 100644 --- a/messages/es.json +++ b/messages/es.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Usuario o contraseña no válidos", "problem_login_invalid_domain_title": "No se permite iniciar sesión desde esta dirección", "problem_o_auth_connection_already_exists_title": "Tu cuenta ya está conectada a este proveedor", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Esta cuenta externa ya está vinculada a otro usuario", "problem_o_auth_flow_anonymous_only_title": "Ya has iniciado sesión", "problem_o_auth_flow_mismatch_title": "El intento de inicio de sesión no coincide", diff --git a/messages/et.json b/messages/et.json index b4075e5f..82bb3d65 100644 --- a/messages/et.json +++ b/messages/et.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Vale kasutajanimi või parool", "problem_login_invalid_domain_title": "Sellelt aadressilt sisselogimine pole lubatud", "problem_o_auth_connection_already_exists_title": "Sinu konto on juba selle teenusepakkujaga ühendatud", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "See väline konto on juba seotud teise kasutajaga", "problem_o_auth_flow_anonymous_only_title": "Oled juba sisse logitud", "problem_o_auth_flow_mismatch_title": "Sisselogimiskatse ei klapi", diff --git a/messages/fi.json b/messages/fi.json index 83b00122..c4a92839 100644 --- a/messages/fi.json +++ b/messages/fi.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Virheellinen käyttäjänimi tai salasana", "problem_login_invalid_domain_title": "Kirjautuminen tästä osoitteesta ei ole sallittua", "problem_o_auth_connection_already_exists_title": "Tilisi on jo yhdistetty tähän palveluun", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Tämä ulkoinen tili on jo liitetty toiseen käyttäjään", "problem_o_auth_flow_anonymous_only_title": "Olet jo kirjautunut sisään", "problem_o_auth_flow_mismatch_title": "Kirjautumisyritys ei täsmää", diff --git a/messages/fr.json b/messages/fr.json index 19f92a7f..619f6fb1 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Nom d'utilisateur ou mot de passe invalide", "problem_login_invalid_domain_title": "La connexion depuis cette adresse n'est pas autorisée", "problem_o_auth_connection_already_exists_title": "Votre compte est déjà connecté à ce fournisseur", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Ce compte externe est déjà associé à un autre utilisateur", "problem_o_auth_flow_anonymous_only_title": "Vous êtes déjà connecté", "problem_o_auth_flow_mismatch_title": "La tentative de connexion ne correspond pas", diff --git a/messages/ja.json b/messages/ja.json index 49fe349e..62ee84df 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -1015,6 +1015,8 @@ "problem_login_invalid_credentials_title": "ユーザー名またはパスワードが正しくありません", "problem_login_invalid_domain_title": "このアドレスからのログインは許可されていません", "problem_o_auth_connection_already_exists_title": "アカウントはすでにこのプロバイダーと連携しています", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "この外部アカウントはすでに別のユーザーと連携しています", "problem_o_auth_flow_anonymous_only_title": "すでにログインしています", "problem_o_auth_flow_mismatch_title": "ログイン試行が一致しません", diff --git a/messages/nb.json b/messages/nb.json index e8db3d28..8555f47c 100644 --- a/messages/nb.json +++ b/messages/nb.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Feil brukernavn eller passord", "problem_login_invalid_domain_title": "Innlogging fra denne adressen er ikke tillatt", "problem_o_auth_connection_already_exists_title": "Kontoen din er allerede koblet til denne tjenesten", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Denne eksterne kontoen er allerede koblet til en annen bruker", "problem_o_auth_flow_anonymous_only_title": "Du er allerede logget inn", "problem_o_auth_flow_mismatch_title": "Opplysningene for innloggingen stemmer ikke overens", diff --git a/messages/nl.json b/messages/nl.json index 008fd897..20eb84cb 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Ongeldige gebruikersnaam of wachtwoord", "problem_login_invalid_domain_title": "Inloggen vanaf dit adres is niet toegestaan", "problem_o_auth_connection_already_exists_title": "Je account is al gekoppeld aan deze provider", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Dit externe account is al gekoppeld aan een andere gebruiker", "problem_o_auth_flow_anonymous_only_title": "Je bent al ingelogd", "problem_o_auth_flow_mismatch_title": "Inlogpoging komt niet overeen", diff --git a/messages/sv.json b/messages/sv.json index 65926ced..746c90a5 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Ogiltigt användarnamn eller lösenord", "problem_login_invalid_domain_title": "Inloggning från den här adressen är inte tillåten", "problem_o_auth_connection_already_exists_title": "Ditt konto är redan anslutet till den här leverantören", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Det här externa kontot är redan kopplat till en annan användare", "problem_o_auth_flow_anonymous_only_title": "Du är redan inloggad", "problem_o_auth_flow_mismatch_title": "Inloggningsförsöket stämmer inte", diff --git a/messages/uk.json b/messages/uk.json index e4342bb7..c83e4d6c 100644 --- a/messages/uk.json +++ b/messages/uk.json @@ -1030,6 +1030,8 @@ "problem_login_invalid_credentials_title": "Неправильне ім'я користувача або пароль", "problem_login_invalid_domain_title": "Вхід із цієї адреси не дозволено", "problem_o_auth_connection_already_exists_title": "Твій обліковий запис уже підключено до цього провайдера", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "Цей зовнішній обліковий запис уже прив'язано до іншого користувача", "problem_o_auth_flow_anonymous_only_title": "Ти вже ввійшов", "problem_o_auth_flow_mismatch_title": "Спроба входу не збігається", diff --git a/messages/uwu.json b/messages/uwu.json index b4ac5393..6c601cf1 100644 --- a/messages/uwu.json +++ b/messages/uwu.json @@ -1020,6 +1020,8 @@ "problem_login_invalid_credentials_title": "Wrong name or pawsword", "problem_login_invalid_domain_title": "Can't log in from here, sorry!", "problem_o_auth_connection_already_exists_title": "You're already holding paws with that buddy", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "That buddy account already belongs to someone else", "problem_o_auth_flow_anonymous_only_title": "You're already snuggled in", "problem_o_auth_flow_mismatch_title": "That login attempt got mixed up", diff --git a/messages/zh-Hans.json b/messages/zh-Hans.json index 06f59f47..5e18a62b 100644 --- a/messages/zh-Hans.json +++ b/messages/zh-Hans.json @@ -1015,6 +1015,8 @@ "problem_login_invalid_credentials_title": "用户名或密码错误", "problem_login_invalid_domain_title": "不允许从此地址登录", "problem_o_auth_connection_already_exists_title": "你的账号已关联此服务", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "此外部账号已关联到其他用户", "problem_o_auth_flow_anonymous_only_title": "你已经登录", "problem_o_auth_flow_mismatch_title": "登录请求不匹配", diff --git a/messages/zh-Hant.json b/messages/zh-Hant.json index 393252a3..e1929c4b 100644 --- a/messages/zh-Hant.json +++ b/messages/zh-Hant.json @@ -1015,6 +1015,8 @@ "problem_login_invalid_credentials_title": "使用者名稱或密碼錯誤", "problem_login_invalid_domain_title": "不允許從此位址登入", "problem_o_auth_connection_already_exists_title": "你的帳號已連結到此服務", + "problem_o_auth_connection_last_login_method_title": "This is your only way to sign in", + "problem_o_auth_connection_last_login_method_desc": "Set a password before disconnecting it.", "problem_o_auth_connection_already_linked_title": "此外部帳號已連結到其他使用者", "problem_o_auth_flow_anonymous_only_title": "你已經登入了", "problem_o_auth_flow_mismatch_title": "登入嘗試不符", diff --git a/src/lib/errorhandling/problemMessages.ts b/src/lib/errorhandling/problemMessages.ts index 63103ee3..1909c963 100644 --- a/src/lib/errorhandling/problemMessages.ts +++ b/src/lib/errorhandling/problemMessages.ts @@ -131,6 +131,10 @@ export const ProblemMessages: { 'Login.InvalidDomain': { title: m.problem_login_invalid_domain_title }, 'OAuth.Connection.AlreadyExists': { title: m.problem_o_auth_connection_already_exists_title }, 'OAuth.Connection.AlreadyLinked': { title: m.problem_o_auth_connection_already_linked_title }, + 'OAuth.Connection.LastLoginMethod': { + title: m.problem_o_auth_connection_last_login_method_title, + description: m.problem_o_auth_connection_last_login_method_desc, + }, 'OAuth.Flow.AnonymousOnly': { title: m.problem_o_auth_flow_anonymous_only_title }, 'OAuth.Flow.Mismatch': { title: m.problem_o_auth_flow_mismatch_title, diff --git a/src/lib/errorhandling/problemTypes.ts b/src/lib/errorhandling/problemTypes.ts index d7dcde6e..18e1a2f0 100644 --- a/src/lib/errorhandling/problemTypes.ts +++ b/src/lib/errorhandling/problemTypes.ts @@ -144,6 +144,10 @@ export const ProblemTypes = { 'OAuth.Connection.AlreadyLinked': { title: 'This external account is already linked to another user', }, + 'OAuth.Connection.LastLoginMethod': { + title: 'This is your only way to sign in', + description: 'Set a password before disconnecting it.', + }, 'OAuth.Flow.AnonymousOnly': { title: 'You are already signed in' }, 'OAuth.Flow.Mismatch': { title: 'Sign-in attempt does not match', From 46a95d8d64d3d3461db6ce5192c9abbd79540407 Mon Sep 17 00:00:00 2001 From: HeavenVR Date: Fri, 4 Dec 2026 17:11:57 +0100 Subject: [PATCH 3/9] chore: Regenerate api --- openapi-ts.config.ts | 2 +- src/lib/api/internal/generated/index.ts | 95 ++- src/lib/api/internal/generated/sdk.gen.ts | 410 +++++++++-- .../internal/generated/transformers.gen.ts | 60 +- src/lib/api/internal/generated/types.gen.ts | 668 ++++++++++++++++-- 5 files changed, 1079 insertions(+), 156 deletions(-) diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts index 29be3ce5..6924b5cd 100644 --- a/openapi-ts.config.ts +++ b/openapi-ts.config.ts @@ -26,7 +26,7 @@ const sharedPlugins = [ // The backend serves one document covering every API version. OPENAPI_INPUT overrides it, // e.g. with a local backend or a saved openapi.json. export default defineConfig({ - input: process.env.OPENAPI_INPUT ?? 'https://api.openshock.dev/openapi.json', + input: process.env.OPENAPI_INPUT ?? 'https://api.openshock.dev/openapi/frontend.json', output: { path: 'src/lib/api/internal/generated', postProcess: ['prettier'], diff --git a/src/lib/api/internal/generated/index.ts b/src/lib/api/internal/generated/index.ts index 05db053c..e593520d 100644 --- a/src/lib/api/internal/generated/index.ts +++ b/src/lib/api/internal/generated/index.ts @@ -3,8 +3,7 @@ export { accountActivate, accountCheckUsername, - accountEmailVerify, - accountEmailVerifyLegacy, + accountGetPendingActivation, accountLoginV2, accountLogout, accountPasswordResetCheckValid, @@ -56,10 +55,14 @@ export { authenticatedAccountChangePassword, authenticatedAccountChangeUsername, authenticatedAccountDeactivate, + authenticatedAccountEmailVerify, + authenticatedAccountEmailVerifyLegacy, authenticatedAccountGetAuditLog, + authenticatedAccountGetProfile, authenticatedAccountGetSelf, authenticatedAccountListOAuthConnections, authenticatedAccountRemoveOAuthConnection, + authenticatedAccountUpdateProfile, deviceGetLiveControlGatewayV2, deviceGetSelf, devicePair, @@ -76,16 +79,21 @@ export { integrationsGetControlStatChanges, publicGetOnlineDevicesStatistics, publicGetPublicShare, + publicGetPublicShareBySlug, + publicGetUserProfile, + publicUnlockPublicShare, sessionsDeleteSession, sessionsGetSelfSession, sessionsListSessions, shareLinksAddShocker, shareLinksCreatePublicShare, shareLinksDeletePublicShare, + shareLinksEditPublicShare, shareLinksEditShocker, shareLinksList, shareLinksPauseShocker, shareLinksRemoveShocker, + shareLinksSetPublicSharePassword, sharesDeleteShareCode, sharesLinkShareCode, shockerEditShocker, @@ -99,6 +107,7 @@ export { shockerRegisterShocker, shockerRemoveShocker, shockerSendControl, + shockerSetShockerPermissions, shockerShockerShareCodeCreate, shockerShockerShareCodeList, shockerShockerShareCodePause, @@ -142,6 +151,7 @@ export { PermissionType, RoleType, ShockerModelType, + SocialPlatform, SortDirection, UsernameAvailability, UsernameErrorType, @@ -152,14 +162,11 @@ export { type AccountCheckUsernameData, type AccountCheckUsernameResponse, type AccountCheckUsernameResponses, - type AccountEmailVerifyData, - type AccountEmailVerifyError, - type AccountEmailVerifyErrors, - type AccountEmailVerifyLegacyData, - type AccountEmailVerifyLegacyError, - type AccountEmailVerifyLegacyErrors, - type AccountEmailVerifyLegacyResponses, - type AccountEmailVerifyResponses, + type AccountGetPendingActivationData, + type AccountGetPendingActivationError, + type AccountGetPendingActivationErrors, + type AccountGetPendingActivationResponse, + type AccountGetPendingActivationResponses, type AccountLoginV2Data, type AccountLoginV2Error, type AccountLoginV2Errors, @@ -189,10 +196,15 @@ export { type AccountSignUpV2Error, type AccountSignUpV2Errors, type AccountSignUpV2Responses, + type ActivateRequest, type AddEmailProviderBlacklistDto, + type AddEmailProviderBlacklistResultDto, type AddUsernameBlacklistDto, type AddWebhookDto, type AdminAddEmailProviderBlacklistData, + type AdminAddEmailProviderBlacklistError, + type AdminAddEmailProviderBlacklistErrors, + type AdminAddEmailProviderBlacklistResponse, type AdminAddEmailProviderBlacklistResponses, type AdminAddUsernameBlacklistData, type AdminAddUsernameBlacklistResponses, @@ -351,7 +363,6 @@ export { type AdminUserViewNameChange, type AdminUserViewPasswordReset, type AdminUserViewShocker, - type AdminUserViewUserActivationRequest, type AdminUserViewUserDeactivation, type AdminUserViewUserRef, type AdminUsersView, @@ -388,9 +399,20 @@ export { type AuthenticatedAccountDeactivateErrors, type AuthenticatedAccountDeactivateResponse, type AuthenticatedAccountDeactivateResponses, + type AuthenticatedAccountEmailVerifyData, + type AuthenticatedAccountEmailVerifyError, + type AuthenticatedAccountEmailVerifyErrors, + type AuthenticatedAccountEmailVerifyLegacyData, + type AuthenticatedAccountEmailVerifyLegacyError, + type AuthenticatedAccountEmailVerifyLegacyErrors, + type AuthenticatedAccountEmailVerifyLegacyResponses, + type AuthenticatedAccountEmailVerifyResponses, type AuthenticatedAccountGetAuditLogData, type AuthenticatedAccountGetAuditLogResponse, type AuthenticatedAccountGetAuditLogResponses, + type AuthenticatedAccountGetProfileData, + type AuthenticatedAccountGetProfileResponse, + type AuthenticatedAccountGetProfileResponses, type AuthenticatedAccountGetSelfData, type AuthenticatedAccountGetSelfResponse, type AuthenticatedAccountGetSelfResponses, @@ -402,6 +424,11 @@ export { type AuthenticatedAccountRemoveOAuthConnectionErrors, type AuthenticatedAccountRemoveOAuthConnectionResponse, type AuthenticatedAccountRemoveOAuthConnectionResponses, + type AuthenticatedAccountUpdateProfileData, + type AuthenticatedAccountUpdateProfileError, + type AuthenticatedAccountUpdateProfileErrors, + type AuthenticatedAccountUpdateProfileResponse, + type AuthenticatedAccountUpdateProfileResponses, type AutomationTokenDto, type BackendInfoResponse, type BasicUserInfo, @@ -502,6 +529,7 @@ export { type IntegrationsGetControlStatChangesResponse, type IntegrationsGetControlStatChangesResponses, type IntensityLimitSettings, + type InvalidEmailProviderDomainsProblem, type LcgNodeResponseV2, type LcgResponseV2, type LegacyDataResponseOfArrayOfAdminOnlineDeviceResponse, @@ -521,6 +549,7 @@ export { type LegacyDataResponseOfLegacyUserSelfResponse, type LegacyDataResponseOfPauseReason, type LegacyDataResponseOfPublicShareResponse, + type LegacyDataResponseOfShockerPermLimitPair, type LegacyDataResponseOfShockerWithDevice, type LegacyDataResponseOfStatsResponse, type LegacyDataResponseOfboolean, @@ -538,6 +567,7 @@ export { type OpenShockProblem, type OtaItem, type OwnPublicShareResponse, + type OwnUserProfileResponse, type OwnerShockerResponse, type PagedResultOfAuditLogEntryResponse, type PagedResultOfLogEntryWithHub, @@ -549,20 +579,44 @@ export { type PauseRequest, type PauseUserShareShockersRequest, type PauseUserShareShockersResponse, + type PendingActivationResponse, type ProblemDetails, type PublicGetOnlineDevicesStatisticsData, type PublicGetOnlineDevicesStatisticsResponse, type PublicGetOnlineDevicesStatisticsResponses, + type PublicGetPublicShareBySlugData, + type PublicGetPublicShareBySlugError, + type PublicGetPublicShareBySlugErrors, + type PublicGetPublicShareBySlugResponse, + type PublicGetPublicShareBySlugResponses, type PublicGetPublicShareData, type PublicGetPublicShareError, type PublicGetPublicShareErrors, type PublicGetPublicShareResponse, type PublicGetPublicShareResponses, + type PublicGetUserProfileData, + type PublicGetUserProfileError, + type PublicGetUserProfileErrors, + type PublicGetUserProfileResponse, + type PublicGetUserProfileResponses, + type PublicShareAuthor, type PublicShareCreate, type PublicShareDevice, + type PublicShareEdit, type PublicShareEditShocker, + type PublicSharePasswordSet, type PublicShareResponse, type PublicShareShocker, + type PublicShareUnlock, + type PublicShareUnlockResponse, + type PublicUnlockPublicShareData, + type PublicUnlockPublicShareError, + type PublicUnlockPublicShareErrors, + type PublicUnlockPublicShareResponse, + type PublicUnlockPublicShareResponses, + type PublicUserProfileDetails, + type PublicUserProfilePublicShare, + type PublicUserProfileResponse, type ReceivedControlStats, type RemoveUserSharesResponse, type ReportTokensRequest, @@ -590,6 +644,8 @@ export { type ShareLinksAddShockerResponse, type ShareLinksAddShockerResponses, type ShareLinksCreatePublicShareData, + type ShareLinksCreatePublicShareError, + type ShareLinksCreatePublicShareErrors, type ShareLinksCreatePublicShareResponse, type ShareLinksCreatePublicShareResponses, type ShareLinksDeletePublicShareData, @@ -597,6 +653,11 @@ export { type ShareLinksDeletePublicShareErrors, type ShareLinksDeletePublicShareResponse, type ShareLinksDeletePublicShareResponses, + type ShareLinksEditPublicShareData, + type ShareLinksEditPublicShareError, + type ShareLinksEditPublicShareErrors, + type ShareLinksEditPublicShareResponse, + type ShareLinksEditPublicShareResponses, type ShareLinksEditShockerData, type ShareLinksEditShockerError, type ShareLinksEditShockerErrors, @@ -615,6 +676,11 @@ export { type ShareLinksRemoveShockerErrors, type ShareLinksRemoveShockerResponse, type ShareLinksRemoveShockerResponses, + type ShareLinksSetPublicSharePasswordData, + type ShareLinksSetPublicSharePasswordError, + type ShareLinksSetPublicSharePasswordErrors, + type ShareLinksSetPublicSharePasswordResponse, + type ShareLinksSetPublicSharePasswordResponses, type SharedDevice, type SharedShocker, type SharesDeleteShareCodeData, @@ -684,6 +750,11 @@ export { type ShockerSendControlErrors, type ShockerSendControlResponse, type ShockerSendControlResponses, + type ShockerSetShockerPermissionsData, + type ShockerSetShockerPermissionsError, + type ShockerSetShockerPermissionsErrors, + type ShockerSetShockerPermissionsResponse, + type ShockerSetShockerPermissionsResponses, type ShockerShockerShareCodeCreateData, type ShockerShockerShareCodeCreateError, type ShockerShockerShareCodeCreateErrors, @@ -746,6 +817,8 @@ export { type UserControlStats, type UserNameBlacklistDto, type UserPatchDto, + type UserProfileSocial, + type UserProfileUpdate, type UserSelfResponse, type UserShareInfo, type UserSharesBulkPauseUserShareShockersData, diff --git a/src/lib/api/internal/generated/sdk.gen.ts b/src/lib/api/internal/generated/sdk.gen.ts index dd8a84eb..9307942f 100644 --- a/src/lib/api/internal/generated/sdk.gen.ts +++ b/src/lib/api/internal/generated/sdk.gen.ts @@ -3,6 +3,7 @@ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client'; import { client } from './client.gen'; import { + accountGetPendingActivationResponseTransformer, adminConfigurationListResponseTransformer, adminCreateAutomationTokenResponseTransformer, adminGetAdminAuditLogResponseTransformer, @@ -26,10 +27,14 @@ import { devicesOtaGetOtaUpdateHistoryResponseTransformer, integrationsGetControlStatChangesResponseTransformer, publicGetOnlineDevicesStatisticsResponseTransformer, + publicGetPublicShareBySlugResponseTransformer, publicGetPublicShareResponseTransformer, + publicUnlockPublicShareResponseTransformer, sessionsGetSelfSessionResponseTransformer, sessionsListSessionsResponseTransformer, + shareLinksEditPublicShareResponseTransformer, shareLinksListResponseTransformer, + shareLinksSetPublicSharePasswordResponseTransformer, shockerGetAllShockerLogsResponseTransformer, shockerGetShockerByIdResponseTransformer, shockerGetShockerLogsResponseTransformer, @@ -53,12 +58,9 @@ import type { AccountActivateResponses, AccountCheckUsernameData, AccountCheckUsernameResponses, - AccountEmailVerifyData, - AccountEmailVerifyErrors, - AccountEmailVerifyLegacyData, - AccountEmailVerifyLegacyErrors, - AccountEmailVerifyLegacyResponses, - AccountEmailVerifyResponses, + AccountGetPendingActivationData, + AccountGetPendingActivationErrors, + AccountGetPendingActivationResponses, AccountLoginV2Data, AccountLoginV2Errors, AccountLoginV2Responses, @@ -80,6 +82,7 @@ import type { AccountSignUpV2Errors, AccountSignUpV2Responses, AdminAddEmailProviderBlacklistData, + AdminAddEmailProviderBlacklistErrors, AdminAddEmailProviderBlacklistResponses, AdminAddUsernameBlacklistData, AdminAddUsernameBlacklistResponses, @@ -204,8 +207,16 @@ import type { AuthenticatedAccountDeactivateData, AuthenticatedAccountDeactivateErrors, AuthenticatedAccountDeactivateResponses, + AuthenticatedAccountEmailVerifyData, + AuthenticatedAccountEmailVerifyErrors, + AuthenticatedAccountEmailVerifyLegacyData, + AuthenticatedAccountEmailVerifyLegacyErrors, + AuthenticatedAccountEmailVerifyLegacyResponses, + AuthenticatedAccountEmailVerifyResponses, AuthenticatedAccountGetAuditLogData, AuthenticatedAccountGetAuditLogResponses, + AuthenticatedAccountGetProfileData, + AuthenticatedAccountGetProfileResponses, AuthenticatedAccountGetSelfData, AuthenticatedAccountGetSelfResponses, AuthenticatedAccountListOAuthConnectionsData, @@ -213,6 +224,9 @@ import type { AuthenticatedAccountRemoveOAuthConnectionData, AuthenticatedAccountRemoveOAuthConnectionErrors, AuthenticatedAccountRemoveOAuthConnectionResponses, + AuthenticatedAccountUpdateProfileData, + AuthenticatedAccountUpdateProfileErrors, + AuthenticatedAccountUpdateProfileResponses, DeviceGetLiveControlGatewayV2Data, DeviceGetLiveControlGatewayV2Errors, DeviceGetLiveControlGatewayV2Responses, @@ -254,9 +268,18 @@ import type { IntegrationsGetControlStatChangesResponses, PublicGetOnlineDevicesStatisticsData, PublicGetOnlineDevicesStatisticsResponses, + PublicGetPublicShareBySlugData, + PublicGetPublicShareBySlugErrors, + PublicGetPublicShareBySlugResponses, PublicGetPublicShareData, PublicGetPublicShareErrors, PublicGetPublicShareResponses, + PublicGetUserProfileData, + PublicGetUserProfileErrors, + PublicGetUserProfileResponses, + PublicUnlockPublicShareData, + PublicUnlockPublicShareErrors, + PublicUnlockPublicShareResponses, SessionsDeleteSessionData, SessionsDeleteSessionErrors, SessionsDeleteSessionResponses, @@ -268,10 +291,14 @@ import type { ShareLinksAddShockerErrors, ShareLinksAddShockerResponses, ShareLinksCreatePublicShareData, + ShareLinksCreatePublicShareErrors, ShareLinksCreatePublicShareResponses, ShareLinksDeletePublicShareData, ShareLinksDeletePublicShareErrors, ShareLinksDeletePublicShareResponses, + ShareLinksEditPublicShareData, + ShareLinksEditPublicShareErrors, + ShareLinksEditPublicShareResponses, ShareLinksEditShockerData, ShareLinksEditShockerErrors, ShareLinksEditShockerResponses, @@ -283,6 +310,9 @@ import type { ShareLinksRemoveShockerData, ShareLinksRemoveShockerErrors, ShareLinksRemoveShockerResponses, + ShareLinksSetPublicSharePasswordData, + ShareLinksSetPublicSharePasswordErrors, + ShareLinksSetPublicSharePasswordResponses, SharesDeleteShareCodeData, SharesDeleteShareCodeErrors, SharesDeleteShareCodeResponses, @@ -319,6 +349,9 @@ import type { ShockerSendControlData, ShockerSendControlErrors, ShockerSendControlResponses, + ShockerSetShockerPermissionsData, + ShockerSetShockerPermissionsErrors, + ShockerSetShockerPermissionsResponses, ShockerShockerShareCodeCreateData, ShockerShockerShareCodeCreateErrors, ShockerShockerShareCodeCreateResponses, @@ -813,6 +846,34 @@ export const shockerSendControl = ( }, }); +/** + * Set the global permissions and limits of a shocker. They apply to every control of the shocker, including + * the owner's own, on top of any share or token restrictions. A null limit means uncapped. The duration limit + * does not apply to live control; disallow live control to bound it. + */ +export const shockerSetShockerPermissions = ( + options: Options +): RequestResult< + ShockerSetShockerPermissionsResponses, + ShockerSetShockerPermissionsErrors, + ThrowOnError, + 'data' +> => + (options.client ?? client).put< + ShockerSetShockerPermissionsResponses, + ShockerSetShockerPermissionsErrors, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/1/shockers/{shockerId}/permissions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + /** * Get all user shares for a shocker */ @@ -1267,10 +1328,15 @@ export const shareLinksList = ( */ export const shareLinksCreatePublicShare = ( options: Options -): RequestResult => +): RequestResult< + ShareLinksCreatePublicShareResponses, + ShareLinksCreatePublicShareErrors, + ThrowOnError, + 'data' +> => (options.client ?? client).post< ShareLinksCreatePublicShareResponses, - unknown, + ShareLinksCreatePublicShareErrors, ThrowOnError, 'data' >({ @@ -1305,6 +1371,33 @@ export const shareLinksDeletePublicShare = ...options, }); +/** + * Edit the name, expiry and slug of a public share + */ +export const shareLinksEditPublicShare = ( + options: Options +): RequestResult< + ShareLinksEditPublicShareResponses, + ShareLinksEditPublicShareErrors, + ThrowOnError, + 'data' +> => + (options.client ?? client).put< + ShareLinksEditPublicShareResponses, + ShareLinksEditPublicShareErrors, + ThrowOnError, + 'data' + >({ + responseTransformer: shareLinksEditPublicShareResponseTransformer, + responseStyle: 'data', + url: '/1/shares/links/{publicShareId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + /** * Pause a shocker in a public share */ @@ -1331,6 +1424,36 @@ export const shareLinksPauseShocker = ( }, }); +/** + * Set, change or remove the password of a public share + * + * Setting or changing the password disconnects everyone currently using the share; they have to enter the + * new one. Removing it keeps them connected. + */ +export const shareLinksSetPublicSharePassword = ( + options: Options +): RequestResult< + ShareLinksSetPublicSharePasswordResponses, + ShareLinksSetPublicSharePasswordErrors, + ThrowOnError, + 'data' +> => + (options.client ?? client).put< + ShareLinksSetPublicSharePasswordResponses, + ShareLinksSetPublicSharePasswordErrors, + ThrowOnError, + 'data' + >({ + responseTransformer: shareLinksSetPublicSharePasswordResponseTransformer, + responseStyle: 'data', + url: '/1/shares/links/{publicShareId}/password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + export const sessionsDeleteSession = ( options: Options ): RequestResult< @@ -1391,6 +1514,23 @@ export const publicGetOnlineDevicesStatistics = ( + options: Options +): RequestResult => + (options.client ?? client).get< + PublicGetUserProfileResponses, + PublicGetUserProfileErrors, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/1/public/users/{username}', + ...options, + }); + /** * Gets information about a public share. */ @@ -1409,6 +1549,56 @@ export const publicGetPublicShare = ( ...options, }); +/** + * Gets information about a public share by its owner's username and custom slug. + */ +export const publicGetPublicShareBySlug = ( + options: Options +): RequestResult< + PublicGetPublicShareBySlugResponses, + PublicGetPublicShareBySlugErrors, + ThrowOnError, + 'data' +> => + (options.client ?? client).get< + PublicGetPublicShareBySlugResponses, + PublicGetPublicShareBySlugErrors, + ThrowOnError, + 'data' + >({ + responseTransformer: publicGetPublicShareBySlugResponseTransformer, + responseStyle: 'data', + url: '/1/public/shares/links/by-slug/{username}/{slug}', + ...options, + }); + +/** + * Unlocks a password-protected public share. + */ +export const publicUnlockPublicShare = ( + options: Options +): RequestResult< + PublicUnlockPublicShareResponses, + PublicUnlockPublicShareErrors, + ThrowOnError, + 'data' +> => + (options.client ?? client).post< + PublicUnlockPublicShareResponses, + PublicUnlockPublicShareErrors, + ThrowOnError, + 'data' + >({ + responseTransformer: publicUnlockPublicShareResponseTransformer, + responseStyle: 'data', + url: '/1/public/shares/links/{publicShareId}/unlock', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + /** * Lets a service holding many users keep their lifetime control stats in sync with a single call per tick. * Returns the lifetime totals of every requested user whose stats changed since the given cursor. @@ -2194,6 +2384,10 @@ export const adminSendTestEmail = ( }, }); +/** + * Lists the email provider blacklist. With match (a domain or an email address), returns only + * the entry that would block signups on that domain, using the same comparison signup does. + */ export const adminListEmailProviderBlacklist = ( options?: Options ): RequestResult => @@ -2209,12 +2403,22 @@ export const adminListEmailProviderBlacklist = ( options: Options -): RequestResult => +): RequestResult< + AdminAddEmailProviderBlacklistResponses, + AdminAddEmailProviderBlacklistErrors, + ThrowOnError, + 'data' +> => (options.client ?? client).post< AdminAddEmailProviderBlacklistResponses, - unknown, + AdminAddEmailProviderBlacklistErrors, ThrowOnError, 'data' >({ @@ -2511,12 +2715,44 @@ export const adminRemoveWebhook = ( }); /** - * Activate account + * The signup this browser holds and can complete, if any + * + * The cookie that marks a browser as holding a signup is not readable by script, so this is how a + * frontend finds out whether to offer the code form, which address the code went to, and whether a + * new code can be requested yet. + */ +export const accountGetPendingActivation = ( + options?: Options +): RequestResult< + AccountGetPendingActivationResponses, + AccountGetPendingActivationErrors, + ThrowOnError, + 'data' +> => + (options?.client ?? client).get< + AccountGetPendingActivationResponses, + AccountGetPendingActivationErrors, + ThrowOnError, + 'data' + >({ + responseTransformer: accountGetPendingActivationResponseTransformer, + responseStyle: 'data', + url: '/1/account/activate', + ...options, + }); + +/** + * Complete the signup this browser holds with the code mailed to its address + * + * The signup is identified by a cookie, set when the signup was started and again when its password or + * linked provider is used to sign in. The code only works together with it: anyone can sign up with + * somebody else's address, so the mail alone proves nothing about who chose the account's credential. + * The account is created by this call. It does not sign in. */ export const accountActivate = ( - options?: Options + options: Options ): RequestResult => - (options?.client ?? client).post< + (options.client ?? client).post< AccountActivateResponses, AccountActivateErrors, ThrowOnError, @@ -2525,6 +2761,10 @@ export const accountActivate = ( responseStyle: 'data', url: '/1/account/activate', ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, }); /** @@ -2648,10 +2888,11 @@ export const accountPasswordResetInitiateV2 = ( options?: Options @@ -2674,6 +2915,9 @@ export const accountResendActivation = ( /** * Signs up a new user + * + * Mails an activation code to the address. The account is created once that code is entered in this + * browser, see POST /1/account/activate. */ export const accountSignUpV2 = ( options: Options @@ -2693,47 +2937,6 @@ export const accountSignUpV2 = ( }, }); -/** - * Verify a pending email change using the token from the verification email. - */ -export const accountEmailVerify = ( - options?: Options -): RequestResult => - (options?.client ?? client).post< - AccountEmailVerifyResponses, - AccountEmailVerifyErrors, - ThrowOnError, - 'data' - >({ - responseStyle: 'data', - url: '/1/account/email-change/verify', - ...options, - }); - -/** - * Verify a pending email change. Deprecated: use POST /email-change/verify instead. - * - * @deprecated - */ -export const accountEmailVerifyLegacy = ( - options?: Options -): RequestResult< - AccountEmailVerifyLegacyResponses, - AccountEmailVerifyLegacyErrors, - ThrowOnError, - 'data' -> => - (options?.client ?? client).post< - AccountEmailVerifyLegacyResponses, - AccountEmailVerifyLegacyErrors, - ThrowOnError, - 'data' - >({ - responseStyle: 'data', - url: '/1/account/verify-email', - ...options, - }); - /** * Initiate an email change for the current user. A verification link is sent to the new * address; the change is not applied until that link is opened. @@ -2914,3 +3117,96 @@ export const authenticatedAccountListOAuthConnections = ( + options?: Options +): RequestResult => + (options?.client ?? client).get< + AuthenticatedAccountGetProfileResponses, + unknown, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/1/account/profile', + ...options, + }); + +/** + * Update the current user's profile settings + */ +export const authenticatedAccountUpdateProfile = ( + options: Options +): RequestResult< + AuthenticatedAccountUpdateProfileResponses, + AuthenticatedAccountUpdateProfileErrors, + ThrowOnError, + 'data' +> => + (options.client ?? client).put< + AuthenticatedAccountUpdateProfileResponses, + AuthenticatedAccountUpdateProfileErrors, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/1/account/profile', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Verify a pending email change of the current user using the token from the verification email. + * + * Requires a session of the account that requested the change. The link is mailed to an address the + * account does not own yet, so opening it proves nothing about the account: accepted anonymously, a + * stranger's click would put their address on someone else's account. + */ +export const authenticatedAccountEmailVerify = ( + options?: Options +): RequestResult< + AuthenticatedAccountEmailVerifyResponses, + AuthenticatedAccountEmailVerifyErrors, + ThrowOnError, + 'data' +> => + (options?.client ?? client).post< + AuthenticatedAccountEmailVerifyResponses, + AuthenticatedAccountEmailVerifyErrors, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/1/account/email-change/verify', + ...options, + }); + +/** + * Verify a pending email change of the current user. Deprecated: use POST /email-change/verify instead. + * + * @deprecated + */ +export const authenticatedAccountEmailVerifyLegacy = ( + options?: Options +): RequestResult< + AuthenticatedAccountEmailVerifyLegacyResponses, + AuthenticatedAccountEmailVerifyLegacyErrors, + ThrowOnError, + 'data' +> => + (options?.client ?? client).post< + AuthenticatedAccountEmailVerifyLegacyResponses, + AuthenticatedAccountEmailVerifyLegacyErrors, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/1/account/verify-email', + ...options, + }); diff --git a/src/lib/api/internal/generated/transformers.gen.ts b/src/lib/api/internal/generated/transformers.gen.ts index 3ccc9ba6..83a13013 100644 --- a/src/lib/api/internal/generated/transformers.gen.ts +++ b/src/lib/api/internal/generated/transformers.gen.ts @@ -3,6 +3,7 @@ import { Temporal } from 'temporal-polyfill'; import type { + AccountGetPendingActivationResponse, AdminConfigurationListResponse, AdminCreateAutomationTokenResponse, AdminGetAdminAuditLogResponse, @@ -26,10 +27,14 @@ import type { DevicesOtaGetOtaUpdateHistoryResponse, IntegrationsGetControlStatChangesResponse, PublicGetOnlineDevicesStatisticsResponse, + PublicGetPublicShareBySlugResponse, PublicGetPublicShareResponse, + PublicUnlockPublicShareResponse, SessionsGetSelfSessionResponse, SessionsListSessionsResponse, + ShareLinksEditPublicShareResponse, ShareLinksListResponse, + ShareLinksSetPublicSharePasswordResponse, ShockerGetAllShockerLogsResponse, ShockerGetShockerByIdResponse, ShockerGetShockerLogsResponse, @@ -353,6 +358,20 @@ export const shareLinksListResponseTransformer = async ( return data; }; +export const shareLinksEditPublicShareResponseTransformer = async ( + data: any +): Promise => { + data = ownPublicShareResponseSchemaResponseTransformer(data); + return data; +}; + +export const shareLinksSetPublicSharePasswordResponseTransformer = async ( + data: any +): Promise => { + data = ownPublicShareResponseSchemaResponseTransformer(data); + return data; +}; + const loginSessionResponseSchemaResponseTransformer = (data: any) => { data.created = Temporal.Instant.from(data.created); data.expires = Temporal.Instant.from(data.expires); @@ -413,6 +432,25 @@ export const publicGetPublicShareResponseTransformer = async ( return data; }; +export const publicGetPublicShareBySlugResponseTransformer = async ( + data: any +): Promise => { + data = legacyDataResponseOfPublicShareResponseSchemaResponseTransformer(data); + return data; +}; + +const publicShareUnlockResponseSchemaResponseTransformer = (data: any) => { + data.expiresOn = Temporal.Instant.from(data.expiresOn); + return data; +}; + +export const publicUnlockPublicShareResponseTransformer = async ( + data: any +): Promise => { + data = publicShareUnlockResponseSchemaResponseTransformer(data); + return data; +}; + const userControlStatTotalsSchemaResponseTransformer = (data: any) => { data.received = data.received.map((item: any) => controlStatTotalsSchemaResponseTransformer(item) @@ -560,11 +598,6 @@ export const adminConfigurationListResponseTransformer = async ( return data; }; -const adminUserViewUserActivationRequestSchemaResponseTransformer = (data: any) => { - data.createdAt = Temporal.Instant.from(data.createdAt); - return data; -}; - const adminUserViewUserDeactivationSchemaResponseTransformer = (data: any) => { if (data.scheduledDeletionTime) { data.scheduledDeletionTime = Temporal.Instant.from(data.scheduledDeletionTime); @@ -623,11 +656,6 @@ const adminUserViewSchemaResponseTransformer = (data: any) => { if (data.activatedAt) { data.activatedAt = Temporal.Instant.from(data.activatedAt); } - if (data.activationRequest) { - data.activationRequest = adminUserViewUserActivationRequestSchemaResponseTransformer( - data.activationRequest - ); - } if (data.deactivation) { data.deactivation = adminUserViewUserDeactivationSchemaResponseTransformer(data.deactivation); } @@ -805,6 +833,18 @@ export const adminListWebhooksResponseTransformer = async ( return data; }; +const pendingActivationResponseSchemaResponseTransformer = (data: any) => { + data.resendAvailableAt = Temporal.Instant.from(data.resendAvailableAt); + return data; +}; + +export const accountGetPendingActivationResponseTransformer = async ( + data: any +): Promise => { + data = pendingActivationResponseSchemaResponseTransformer(data); + return data; +}; + export const authenticatedAccountGetAuditLogResponseTransformer = async ( data: any ): Promise => { diff --git a/src/lib/api/internal/generated/types.gen.ts b/src/lib/api/internal/generated/types.gen.ts index 4b13b136..b249ea03 100644 --- a/src/lib/api/internal/generated/types.gen.ts +++ b/src/lib/api/internal/generated/types.gen.ts @@ -7,10 +7,39 @@ export type ClientOptions = { 'https://api.openshock.app' | 'https://api.openshock.dev' | 'https://localhost' | (string & {}); }; +export type ActivateRequest = { + /** + * The code from the activation email. Case and the dash do not matter. + */ + code: string; +}; + export type AddEmailProviderBlacklistDto = { + /** + * Domains to blacklist. Full email addresses are accepted too and contribute their domain; blank entries are + * ignored. Every other entry must be a valid domain, or nothing is added. + */ domains: Array; }; +/** + * Outcome of adding domains to the email provider blacklist. + */ +export type AddEmailProviderBlacklistResultDto = { + /** + * Distinct domains in the request, after normalising and dropping blank entries. + */ + submitted: number; + /** + * Domains that were newly added. + */ + added: number; + /** + * Domains that were already on the blacklist. + */ + alreadyListed?: number; +}; + export type AddUsernameBlacklistDto = { value: string; matchType: MatchTypeEnum; @@ -71,7 +100,6 @@ export type AdminUserView = { createdAt: Temporal.Instant; activatedAt: null | Temporal.Instant; createdByAutomationTokenId: null | string; - activationRequest: null | AdminUserViewUserActivationRequest; deactivation: null | AdminUserViewUserDeactivation; hubs: Array; apiTokens: Array; @@ -128,11 +156,6 @@ export type AdminUserViewShocker = { createdAt: Temporal.Instant; }; -export type AdminUserViewUserActivationRequest = { - emailSendAttempts: number; - createdAt: Temporal.Instant; -}; - export type AdminUserViewUserDeactivation = { deactivatedBy: AdminUserViewUserRef; scheduledDeletionTime: null | Temporal.Instant; @@ -614,7 +637,7 @@ export type CreateTokenRequestV2 = { name: string; permissions: Array; /** - * Per-token shocker control configuration. When omitted, the permissive default is used. + * Per-token shocker control configuration. Required: a request without it is rejected. */ shockerControl: ShockerControlSettings; }; @@ -674,7 +697,7 @@ export type EditTokenRequestV2 = { name: string; permissions: Array; /** - * Per-token shocker control configuration. When omitted, the permissive default is used. + * Per-token shocker control configuration. Required: a request without it is rejected. */ shockerControl: ShockerControlSettings; }; @@ -791,6 +814,25 @@ export type IntensityLimitSettings = { mode: ControlLimitMode; }; +export type InvalidEmailProviderDomainsProblem = { + type?: null | string; + title?: null | string; + status?: null | number; + detail?: null | string; + instance?: null | string; + invalidCount?: number; + invalidEntries?: Array; + /** + * @deprecated + */ + message?: string; + /** + * @deprecated + */ + traceId?: null | string; + requestId?: null | string; +}; + export type LcgNodeResponseV2 = { host: string; port: number; @@ -912,6 +954,11 @@ export type LegacyDataResponseOfPublicShareResponse = { data: PublicShareResponse; }; +export type LegacyDataResponseOfShockerPermLimitPair = { + message: string; + data: ShockerPermLimitPair; +}; + export type LegacyDataResponseOfShockerWithDevice = { message: string; data: ShockerWithDevice; @@ -1072,8 +1119,18 @@ export type OtaUpdateStatus = (typeof OtaUpdateStatus)[keyof typeof OtaUpdateSta export type OwnPublicShareResponse = { id: string; name: string; + slug: null | string; createdOn: Temporal.Instant; expiresOn?: null | Temporal.Instant; + hasPassword: boolean; +}; + +export type OwnUserProfileResponse = { + isPublic: boolean; + pronouns: null | string; + bio: null | string; + socials: Array; + defaultPublicShareId: null | string; }; export type OwnerShockerResponse = { @@ -1190,6 +1247,22 @@ export type PauseUserShareShockersResponse = { }; }; +export type PendingActivationResponse = { + /** + * The address the code was mailed to. + */ + email: string; + username: string; + /** + * When a new code can be requested. In the past when one can be requested now. + */ + resendAvailableAt: Temporal.Instant; + /** + * How many more codes can be requested today. At zero a resend is refused whatever the time. + */ + resendsRemaining: number; +}; + export const PermissionType = { ShockersUse: 'shockers.use', ShockersEdit: 'shockers.edit', @@ -1212,9 +1285,24 @@ export type ProblemDetails = { instance?: null | string; }; +export type PublicShareAuthor = { + id: string; + name: string; + image: string; + profile: null | PublicUserProfileDetails; +}; + export type PublicShareCreate = { name: string; expiresOn?: null | Temporal.Instant; + /** + * Custom URL segment, reachable at /u/{username}/{slug}. Unique per owner. + */ + slug?: null | string; + /** + * Optional password visitors must enter before they can see or control the shockers. + */ + password?: null | string; }; export type PublicShareDevice = { @@ -1223,18 +1311,43 @@ export type PublicShareDevice = { shockers: Array; }; +/** + * Replaces all editable fields of a public share, null clears the expiry or slug. + */ +export type PublicShareEdit = { + name: string; + expiresOn: null | Temporal.Instant; + slug: null | string; +}; + export type PublicShareEditShocker = { permissions: ShockerPermissions; limits: ShockerLimits; cooldown?: null | number; }; +export type PublicSharePasswordSet = { + /** + * The new password, or null to remove it. Setting or changing it disconnects everyone currently using the share. + */ + password: null | string; +}; + export type PublicShareResponse = { id: string; name: string; + slug: null | string; createdOn: Temporal.Instant; expiresOn?: null | Temporal.Instant; - author: BasicUserInfo; + author: PublicShareAuthor; + /** + * Visitors have to enter a password before they can see or control the shockers. + */ + passwordProtected: boolean; + /** + * The share is password protected and this request did not unlock it: IList<PublicShareDevice> PublicShareResponse.Devices is empty. + */ + passwordRequired: boolean; devices?: Array; }; @@ -1258,6 +1371,38 @@ export type PublicShareShocker = { paused: number; }; +export type PublicShareUnlock = { + password: string; +}; + +export type PublicShareUnlockResponse = { + /** + * Send it in the OpenShockPublicShareUnlock header when loading the share, and as the unlockToken query + * parameter when connecting to its hub. Invalid once the password is changed. + */ + token: string; + expiresOn: Temporal.Instant; +}; + +export type PublicUserProfileDetails = { + pronouns: null | string; + bio: null | string; + socials: Array; +}; + +export type PublicUserProfilePublicShare = { + id: string; + name: string; + slug: null | string; + passwordProtected: boolean; +}; + +export type PublicUserProfileResponse = { + user: BasicUserInfo; + profile: PublicUserProfileDetails; + defaultPublicShare: null | PublicUserProfilePublicShare; +}; + export type ReceivedControlStats = { totals: Array; shockers: Array; @@ -1379,6 +1524,9 @@ export type ShockerControlStats = { export type ShockerLimits = { intensity: null | number; + /** + * Maximum duration in milliseconds. Does not apply to live control, which has no fixed duration. + */ duration: null | number; }; @@ -1419,6 +1567,8 @@ export type ShockerPermissions = { export type ShockerResponse = { name: string; isPaused: boolean; + permissions: ShockerPermissions; + limits: ShockerLimits; createdOn: Temporal.Instant; id: string; rfId: number; @@ -1429,6 +1579,8 @@ export type ShockerWithDevice = { device: string; name: string; isPaused: boolean; + permissions: ShockerPermissions; + limits: ShockerLimits; createdOn: Temporal.Instant; id: string; rfId: number; @@ -1442,6 +1594,25 @@ export type SignUpV2 = { turnstileResponse: string; }; +export const SocialPlatform = { + Website: 'Website', + Discord: 'Discord', + X: 'X', + Bluesky: 'Bluesky', + Mastodon: 'Mastodon', + Twitch: 'Twitch', + YouTube: 'YouTube', + Kick: 'Kick', + Reddit: 'Reddit', + Instagram: 'Instagram', + TikTok: 'TikTok', + GitHub: 'GitHub', + Telegram: 'Telegram', + FetLife: 'FetLife', +} as const; + +export type SocialPlatform = (typeof SocialPlatform)[keyof typeof SocialPlatform]; + /** * Sort direction for list endpoints. */ @@ -1520,6 +1691,25 @@ export type UserPatchDto = { email?: null | string; }; +export type UserProfileSocial = { + platform: SocialPlatform; + /** + * An absolute http(s) URL for SocialPlatform.Website, otherwise the handle on that platform. + */ + value: string; +}; + +export type UserProfileUpdate = { + isPublic: boolean; + pronouns?: null | string; + bio?: null | string; + socials?: Array; + /** + * Public share shown on the profile page, must be one of your own unexpired public shares. + */ + defaultPublicShareId?: null | string; +}; + export type UserSelfResponse = { id: string; name: string; @@ -2166,6 +2356,35 @@ export type ShockerSendControlResponses = { export type ShockerSendControlResponse = ShockerSendControlResponses[keyof ShockerSendControlResponses]; +export type ShockerSetShockerPermissionsData = { + body: ShockerPermLimitPair; + path: { + shockerId: string; + }; + query?: never; + url: '/1/shockers/{shockerId}/permissions'; +}; + +export type ShockerSetShockerPermissionsErrors = { + /** + * Shocker not found or does not belong to you + */ + 404: OpenShockProblem; +}; + +export type ShockerSetShockerPermissionsError = + ShockerSetShockerPermissionsErrors[keyof ShockerSetShockerPermissionsErrors]; + +export type ShockerSetShockerPermissionsResponses = { + /** + * Successfully set the permissions and limits + */ + 200: LegacyDataResponseOfShockerPermLimitPair; +}; + +export type ShockerSetShockerPermissionsResponse = + ShockerSetShockerPermissionsResponses[keyof ShockerSetShockerPermissionsResponses]; + export type ShockerGetUserSharesData = { body?: never; path: { @@ -2387,6 +2606,10 @@ export type SharesLinkShareCodeErrors = { * Share code not found or does not belong to you */ 404: OpenShockProblem; + /** + * Conflict + */ + 409: OpenShockProblem; /** * Error while linking share code to your account */ @@ -2553,6 +2776,10 @@ export type UserSharesRedeemInviteErrors = { * Not Found */ 404: OpenShockProblem; + /** + * Conflict + */ + 409: OpenShockProblem; }; export type UserSharesRedeemInviteError = @@ -2757,6 +2984,20 @@ export type ShareLinksCreatePublicShareData = { url: '/1/shares/links'; }; +export type ShareLinksCreatePublicShareErrors = { + /** + * Bad Request + */ + 400: OpenShockProblem; + /** + * You have reached the maximum number of public shares + */ + 409: OpenShockProblem; +}; + +export type ShareLinksCreatePublicShareError = + ShareLinksCreatePublicShareErrors[keyof ShareLinksCreatePublicShareErrors]; + export type ShareLinksCreatePublicShareResponses = { /** * The created public share @@ -2796,6 +3037,43 @@ export type ShareLinksDeletePublicShareResponses = { export type ShareLinksDeletePublicShareResponse = ShareLinksDeletePublicShareResponses[keyof ShareLinksDeletePublicShareResponses]; +export type ShareLinksEditPublicShareData = { + body: PublicShareEdit; + path: { + publicShareId: string; + }; + query?: never; + url: '/1/shares/links/{publicShareId}'; +}; + +export type ShareLinksEditPublicShareErrors = { + /** + * Expiry date in the past or invalid slug + */ + 400: OpenShockProblem; + /** + * Public share not found or does not belong to you + */ + 404: OpenShockProblem; + /** + * Slug is already used by another of your public shares + */ + 409: OpenShockProblem; +}; + +export type ShareLinksEditPublicShareError = + ShareLinksEditPublicShareErrors[keyof ShareLinksEditPublicShareErrors]; + +export type ShareLinksEditPublicShareResponses = { + /** + * The updated public share + */ + 200: OwnPublicShareResponse; +}; + +export type ShareLinksEditPublicShareResponse = + ShareLinksEditPublicShareResponses[keyof ShareLinksEditPublicShareResponses]; + export type ShareLinksPauseShockerData = { body: PauseRequest; path: { @@ -2830,6 +3108,35 @@ export type ShareLinksPauseShockerResponses = { export type ShareLinksPauseShockerResponse = ShareLinksPauseShockerResponses[keyof ShareLinksPauseShockerResponses]; +export type ShareLinksSetPublicSharePasswordData = { + body: PublicSharePasswordSet; + path: { + publicShareId: string; + }; + query?: never; + url: '/1/shares/links/{publicShareId}/password'; +}; + +export type ShareLinksSetPublicSharePasswordErrors = { + /** + * Public share not found or does not belong to you + */ + 404: OpenShockProblem; +}; + +export type ShareLinksSetPublicSharePasswordError = + ShareLinksSetPublicSharePasswordErrors[keyof ShareLinksSetPublicSharePasswordErrors]; + +export type ShareLinksSetPublicSharePasswordResponses = { + /** + * The updated public share + */ + 200: OwnPublicShareResponse; +}; + +export type ShareLinksSetPublicSharePasswordResponse = + ShareLinksSetPublicSharePasswordResponses[keyof ShareLinksSetPublicSharePasswordResponses]; + export type SessionsDeleteSessionData = { body?: never; path: { @@ -2907,8 +3214,43 @@ export type PublicGetOnlineDevicesStatisticsResponses = { export type PublicGetOnlineDevicesStatisticsResponse = PublicGetOnlineDevicesStatisticsResponses[keyof PublicGetOnlineDevicesStatisticsResponses]; +export type PublicGetUserProfileData = { + body?: never; + path: { + username: string; + }; + query?: never; + url: '/1/public/users/{username}'; +}; + +export type PublicGetUserProfileErrors = { + /** + * The user does not exist or their profile is not public. + */ + 404: OpenShockProblem; +}; + +export type PublicGetUserProfileError = + PublicGetUserProfileErrors[keyof PublicGetUserProfileErrors]; + +export type PublicGetUserProfileResponses = { + /** + * The profile was successfully retrieved. + */ + 200: PublicUserProfileResponse; +}; + +export type PublicGetUserProfileResponse = + PublicGetUserProfileResponses[keyof PublicGetUserProfileResponses]; + export type PublicGetPublicShareData = { body?: never; + headers?: { + /** + * The token from unlocking a password-protected share. + */ + OpenShockPublicShareUnlock?: string; + }; path: { publicShareId: string; }; @@ -2936,6 +3278,83 @@ export type PublicGetPublicShareResponses = { export type PublicGetPublicShareResponse = PublicGetPublicShareResponses[keyof PublicGetPublicShareResponses]; +export type PublicGetPublicShareBySlugData = { + body?: never; + headers?: { + /** + * The token from unlocking a password-protected share. + */ + OpenShockPublicShareUnlock?: string; + }; + path: { + username: string; + slug: string; + }; + query?: never; + url: '/1/public/shares/links/by-slug/{username}/{slug}'; +}; + +export type PublicGetPublicShareBySlugErrors = { + /** + * The public share does not exist. + */ + 404: OpenShockProblem; +}; + +export type PublicGetPublicShareBySlugError = + PublicGetPublicShareBySlugErrors[keyof PublicGetPublicShareBySlugErrors]; + +export type PublicGetPublicShareBySlugResponses = { + /** + * The public share information was successfully retrieved. + */ + 200: LegacyDataResponseOfPublicShareResponse; +}; + +export type PublicGetPublicShareBySlugResponse = + PublicGetPublicShareBySlugResponses[keyof PublicGetPublicShareBySlugResponses]; + +export type PublicUnlockPublicShareData = { + body: PublicShareUnlock; + path: { + publicShareId: string; + }; + query?: never; + url: '/1/public/shares/links/{publicShareId}/unlock'; +}; + +export type PublicUnlockPublicShareErrors = { + /** + * The public share has no password. + */ + 400: OpenShockProblem; + /** + * The password was incorrect. + */ + 401: OpenShockProblem; + /** + * The public share does not exist. + */ + 404: OpenShockProblem; + /** + * Too many incorrect passwords were entered for this public share. + */ + 429: OpenShockProblem; +}; + +export type PublicUnlockPublicShareError = + PublicUnlockPublicShareErrors[keyof PublicUnlockPublicShareErrors]; + +export type PublicUnlockPublicShareResponses = { + /** + * The password was correct. + */ + 200: PublicShareUnlockResponse; +}; + +export type PublicUnlockPublicShareResponse = + PublicUnlockPublicShareResponses[keyof PublicUnlockPublicShareResponses]; + export type IntegrationsGetControlStatChangesData = { body: ControlStatChangesRequest; path?: never; @@ -3973,13 +4392,26 @@ export type AdminAddEmailProviderBlacklistData = { url: '/1/admin/blacklist/emailProviders'; }; +export type AdminAddEmailProviderBlacklistErrors = { + /** + * Bad Request + */ + 400: InvalidEmailProviderDomainsProblem; +}; + +export type AdminAddEmailProviderBlacklistError = + AdminAddEmailProviderBlacklistErrors[keyof AdminAddEmailProviderBlacklistErrors]; + export type AdminAddEmailProviderBlacklistResponses = { /** * OK */ - 200: unknown; + 200: AddEmailProviderBlacklistResultDto; }; +export type AdminAddEmailProviderBlacklistResponse = + AdminAddEmailProviderBlacklistResponses[keyof AdminAddEmailProviderBlacklistResponses]; + export type AdminRemoveEmailProviderBlacklistData = { body?: never; path: { @@ -4391,27 +4823,56 @@ export type AdminRemoveWebhookResponses = { 200: unknown; }; -export type AccountActivateData = { +export type AccountGetPendingActivationData = { body?: never; path?: never; - query?: { - token?: string; - }; + query?: never; + url: '/1/account/activate'; +}; + +export type AccountGetPendingActivationErrors = { + /** + * This browser holds no pending signup + */ + 400: OpenShockProblem; +}; + +export type AccountGetPendingActivationError = + AccountGetPendingActivationErrors[keyof AccountGetPendingActivationErrors]; + +export type AccountGetPendingActivationResponses = { + /** + * This browser holds a pending signup + */ + 200: PendingActivationResponse; +}; + +export type AccountGetPendingActivationResponse = + AccountGetPendingActivationResponses[keyof AccountGetPendingActivationResponses]; + +export type AccountActivateData = { + body: ActivateRequest; + path?: never; + query?: never; url: '/1/account/activate'; }; export type AccountActivateErrors = { /** - * Bad Request + * This browser holds no pending signup, the code is wrong, or it has expired */ 400: OpenShockProblem; + /** + * The email or username was taken while the signup was pending. The signup is gone: sign up again + */ + 409: OpenShockProblem; }; export type AccountActivateError = AccountActivateErrors[keyof AccountActivateErrors]; export type AccountActivateResponses = { /** - * OK + * Account created */ 200: unknown; }; @@ -4581,7 +5042,7 @@ export type AccountResendActivationData = { export type AccountResendActivationErrors = { /** - * No pending activation for this browser (missing/expired cookie, or already activated) + * No pending signup for this browser (missing/expired cookie, or already completed) */ 400: OpenShockProblem; /** @@ -4620,72 +5081,17 @@ export type AccountSignUpV2Errors = { * Conflict */ 409: OpenShockProblem; -}; - -export type AccountSignUpV2Error = AccountSignUpV2Errors[keyof AccountSignUpV2Errors]; - -export type AccountSignUpV2Responses = { - /** - * User successfully signed up - */ - 200: unknown; -}; - -export type AccountEmailVerifyData = { - body?: never; - path?: never; - query?: { - token?: string; - }; - url: '/1/account/email-change/verify'; -}; - -export type AccountEmailVerifyErrors = { - /** - * Token is invalid, already used, or the request has expired - */ - 400: OpenShockProblem; - /** - * The new email address was claimed by another account before verification completed - */ - 409: OpenShockProblem; -}; - -export type AccountEmailVerifyError = AccountEmailVerifyErrors[keyof AccountEmailVerifyErrors]; - -export type AccountEmailVerifyResponses = { /** - * Email change verified and applied + * The address was mailed too many activation codes already */ - 200: unknown; -}; - -export type AccountEmailVerifyLegacyData = { - body?: never; - path?: never; - query?: { - token?: string; - }; - url: '/1/account/verify-email'; -}; - -export type AccountEmailVerifyLegacyErrors = { - /** - * Token is invalid, already used, or the request has expired - */ - 400: OpenShockProblem; - /** - * The new email address was claimed by another account before verification completed - */ - 409: OpenShockProblem; + 429: OpenShockProblem; }; -export type AccountEmailVerifyLegacyError = - AccountEmailVerifyLegacyErrors[keyof AccountEmailVerifyLegacyErrors]; +export type AccountSignUpV2Error = AccountSignUpV2Errors[keyof AccountSignUpV2Errors]; -export type AccountEmailVerifyLegacyResponses = { +export type AccountSignUpV2Responses = { /** - * Email change verified and applied + * Signup started, activation code mailed */ 200: unknown; }; @@ -4892,6 +5298,10 @@ export type AuthenticatedAccountRemoveOAuthConnectionErrors = { * No connection found for this provider. */ 404: ProblemDetails; + /** + * The connection is the account's only way to sign in. + */ + 409: OpenShockProblem; }; export type AuthenticatedAccountRemoveOAuthConnectionError = @@ -4923,3 +5333,107 @@ export type AuthenticatedAccountListOAuthConnectionsResponses = { export type AuthenticatedAccountListOAuthConnectionsResponse = AuthenticatedAccountListOAuthConnectionsResponses[keyof AuthenticatedAccountListOAuthConnectionsResponses]; + +export type AuthenticatedAccountGetProfileData = { + body?: never; + path?: never; + query?: never; + url: '/1/account/profile'; +}; + +export type AuthenticatedAccountGetProfileResponses = { + /** + * The profile settings, defaults when the profile was never set up + */ + 200: OwnUserProfileResponse; +}; + +export type AuthenticatedAccountGetProfileResponse = + AuthenticatedAccountGetProfileResponses[keyof AuthenticatedAccountGetProfileResponses]; + +export type AuthenticatedAccountUpdateProfileData = { + body: UserProfileUpdate; + path?: never; + query?: never; + url: '/1/account/profile'; +}; + +export type AuthenticatedAccountUpdateProfileErrors = { + /** + * Invalid social or default public share + */ + 400: OpenShockProblem; +}; + +export type AuthenticatedAccountUpdateProfileError = + AuthenticatedAccountUpdateProfileErrors[keyof AuthenticatedAccountUpdateProfileErrors]; + +export type AuthenticatedAccountUpdateProfileResponses = { + /** + * The updated profile settings + */ + 200: OwnUserProfileResponse; +}; + +export type AuthenticatedAccountUpdateProfileResponse = + AuthenticatedAccountUpdateProfileResponses[keyof AuthenticatedAccountUpdateProfileResponses]; + +export type AuthenticatedAccountEmailVerifyData = { + body?: never; + path?: never; + query?: { + token?: string; + }; + url: '/1/account/email-change/verify'; +}; + +export type AuthenticatedAccountEmailVerifyErrors = { + /** + * Token is invalid, already used, expired, or belongs to another account + */ + 400: OpenShockProblem; + /** + * The new email address was claimed by another account before verification completed + */ + 409: OpenShockProblem; +}; + +export type AuthenticatedAccountEmailVerifyError = + AuthenticatedAccountEmailVerifyErrors[keyof AuthenticatedAccountEmailVerifyErrors]; + +export type AuthenticatedAccountEmailVerifyResponses = { + /** + * Email change verified and applied + */ + 200: unknown; +}; + +export type AuthenticatedAccountEmailVerifyLegacyData = { + body?: never; + path?: never; + query?: { + token?: string; + }; + url: '/1/account/verify-email'; +}; + +export type AuthenticatedAccountEmailVerifyLegacyErrors = { + /** + * Token is invalid, already used, expired, or belongs to another account + */ + 400: OpenShockProblem; + /** + * The new email address was claimed by another account before verification completed + */ + 409: OpenShockProblem; +}; + +export type AuthenticatedAccountEmailVerifyLegacyError = + AuthenticatedAccountEmailVerifyLegacyErrors[keyof AuthenticatedAccountEmailVerifyLegacyErrors]; + +export type AuthenticatedAccountEmailVerifyLegacyResponses = { + /** + * Email change verified and applied + */ + 200: unknown; +}; From 8f7de6a67ddc1f1d5448c78a463cc26b6ace6a96 Mon Sep 17 00:00:00 2001 From: HeavenVR Date: Fri, 4 Dec 2026 20:20:47 +0100 Subject: [PATCH 4/9] feat: activate signups with a mailed code The API no longer creates an account at signup: it mails a code that only works in the browser holding the signup cookie (OpenShock/API#406). - /activate is now a code form: GET /1/account/activate tells it where the code went and when a new one can be sent; POST creates the account. - Signup with mail enabled, an unverified OAuth signup, and a login with the password of an unfinished signup all continue on /activate. - A login that hits an account with no signup to resume (left unactivated by the migration) says to contact support; the admin user page flags these. - The OAuth create page links to /activate when it resumes a pending signup. - Email change verification uses the generated client. - 429 responses that carry a known problem type, such as Account.Activation.ResendTooMany, show that problem instead of the generic rate limit toast. - Drops the token-and-password activation flow and the readable resend cookie. --- messages/de.json | 28 +- messages/en.json | 55 ++-- messages/es.json | 28 +- messages/et.json | 28 +- messages/fi.json | 28 +- messages/fr.json | 28 +- messages/ja.json | 28 +- messages/nb.json | 28 +- messages/nl.json | 28 +- messages/sv.json | 28 +- messages/uk.json | 28 +- messages/uwu.json | 28 +- messages/zh-Hans.json | 28 +- messages/zh-Hant.json | 28 +- src/lib/api/next/account.ts | 130 --------- src/lib/api/next/oauth.ts | 11 +- src/lib/auth/oauth-errors.ts | 2 +- src/lib/components/auth/oauth-buttons.svelte | 8 +- .../auth/resend-activation-button.svelte | 45 ---- src/lib/errorhandling/apiErrorHandling.ts | 16 +- src/lib/errorhandling/problemMessages.ts | 6 + src/lib/errorhandling/problemTypes.ts | 16 +- .../admin/users/[userId=guid]/+page.svelte | 10 +- src/routes/(app)/verify-email/+page.svelte | 27 +- src/routes/(auth)/activate/+page.svelte | 248 ++++++++++++------ src/routes/(auth)/login/+page.svelte | 54 ++-- .../oauth/[provider]/create/+page.svelte | 22 +- src/routes/(auth)/signup/+page.svelte | 22 +- 28 files changed, 411 insertions(+), 625 deletions(-) delete mode 100644 src/lib/api/next/account.ts delete mode 100644 src/lib/components/auth/resend-activation-button.svelte diff --git a/messages/de.json b/messages/de.json index 3b64954a..76a34b0f 100644 --- a/messages/de.json +++ b/messages/de.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Konto aktivieren", "auth_activate_title": "Konto aktivieren", - "auth_activate_activating": "Dein Konto wird aktiviert...", - "auth_activate_success": "Dein Konto wurde aktiviert", - "auth_activate_failed": "Dieser Aktivierungslink ist ungültig oder abgelaufen", - "auth_activate_missing_token": "Aktivierungstoken fehlt", - "auth_activate_continue": "Weiter zur Anmeldung", "auth_activate_toast_success": "Konto aktiviert", "auth_forgot_breadcrumb": "Passwort vergessen", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Verfügbare Anmeldemethoden werden geladen", "auth_login_choose_method": "Melde dich mit einer dieser Methoden an", "auth_login_with_account": "Melde dich mit deinem OpenShock-Konto an", - "auth_login_activation_after_signup": "Dein Konto wurde erstellt. Wir haben dir einen Aktivierungslink per E-Mail geschickt. Sieh in deinem Posteingang und im Spam-Ordner nach.", - "auth_login_activation_pending": "Dein Konto ist noch nicht aktiviert. Wir haben dir einen Aktivierungslink per E-Mail geschickt. Sieh in deinem Posteingang und im Spam-Ordner nach. Falls nichts ankommt, melde dich später erneut an, um einen neuen Link zu erhalten.", "auth_login_oauth_only": "Dieses Konto hat kein Passwort. Melde dich über den Anbieter an, mit dem du dich registriert hast.", "auth_login_oauth_only_with_buttons": "Dieses Konto hat kein Passwort. Melde dich über die Schaltflächen oben mit dem Anbieter an, mit dem du dich registriert hast.", "auth_login_or_continue_with": "Oder weiter mit", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Passwort wurde zurückgesetzt", "auth_signup_breadcrumb": "Registrieren", - "auth_signup_toast_created_mail": "Konto erfolgreich erstellt. Bitte sieh in deinen E-Mails nach, um dein Konto zu bestätigen.", "auth_signup_toast_created_no_mail": "Konto erfolgreich erstellt. Du kannst dich jetzt anmelden.", "auth_signup_dialog_title": "Willkommen! Danke für deine Registrierung! ❤️", - "auth_signup_dialog_created_mail": "Dein Konto wurde erstellt. 🎉 Bitte sieh in deinen E-Mails nach, um dein Konto zu bestätigen.", - "auth_signup_dialog_verify_then_login": "Nachdem du deine E-Mail-Adresse bestätigt hast, kannst du dich anmelden.", "auth_signup_dialog_created_no_mail": "Dein Konto wurde erstellt und ist einsatzbereit. 🎉", "auth_signup_dialog_login_now": "Du kannst dich jetzt anmelden.", "auth_signup_title": "Konto erstellen", @@ -906,10 +896,6 @@ "report_submit": "Meldung senden", "turnstile_disabled": "Turnstile deaktiviert", "common_internal_error": "Interner Fehler", - "resend_toast_sent": "Aktivierungs-E-Mail gesendet. Sieh in deinem Posteingang und Spam-Ordner nach.", - "resend_toast_throttled": "Es wurden zu viele Aktivierungs-E-Mails angefordert. Versuche es später erneut.", - "resend_toast_unavailable": "Aus diesem Browser kann keine Aktivierungs-E-Mail erneut gesendet werden. Ist dein Konto noch nicht aktiviert, sendet eine Anmeldung einen neuen Link.", - "resend_button": "Keine E-Mail erhalten? Erneut senden", "expiration_label": "Ablauf", "expiration_never": "Nie", "expiration_custom": "Benutzerdefiniert", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Anwendungsmodus konnte nicht gestartet werden: {{error}}", "problem_account_account_not_activated_title": "Konto nicht aktiviert", - "problem_account_account_not_activated_desc": "Sieh in deinem Posteingang nach der Aktivierungs-E-Mail.", - "problem_account_activation_not_found_title": "Der Aktivierungslink ist ungültig", - "problem_account_activation_not_found_desc": "Der Link ist möglicherweise abgelaufen oder wurde bereits verwendet.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Zu viele Aktivierungs-E-Mails angefordert", "problem_account_activation_resend_too_many_desc": "Warte eine Weile, bevor du es erneut versuchst.", - "problem_account_activation_resend_unavailable_title": "Aktivierungs-E-Mail kann nicht erneut gesendet werden", - "problem_account_activation_resend_unavailable_desc": "Melde dich erneut an, um einen neuen Aktivierungslink anzufordern.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Das Konto ist bereits deaktiviert", "problem_account_deactivate_denied_privileged_title": "Privilegierte Konten können nicht deaktiviert werden", "problem_account_deactivate_unauthorized_title": "Das darfst du nicht", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Bitte melde dich erneut an.", "problem_authentication_token_invalid_title": "Ungültiges API-Token", "problem_authentication_unknown_error_title": "Authentifizierung fehlgeschlagen", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Dazu hast du keine Berechtigung", "problem_authorization_token_only_title": "Diese Aktion erfordert ein API-Token", "problem_authorization_token_permission_missing_title": "Diesem API-Token fehlt eine erforderliche Berechtigung", diff --git a/messages/en.json b/messages/en.json index e35a0868..92e1a859 100644 --- a/messages/en.json +++ b/messages/en.json @@ -67,18 +67,23 @@ "auth_activate_breadcrumb": "Activate Account", "auth_activate_title": "Activate Account", - "auth_activate_activating": "Activating your account...", - "auth_activate_success": "Your account has been activated", - "auth_activate_failed": "This activation link is invalid or has expired", - "auth_activate_missing_token": "Missing activation token", - "auth_activate_continue": "Continue to login", + "auth_activate_loading": "Checking your signup...", + "auth_activate_description": "We sent a code to
{{email}}
. Enter it to create your account.", + "auth_activate_code_label": "Activation code", + "auth_activate_code_hint": "The code is valid for one hour. Check your spam folder if it hasn't arrived.", + "auth_activate_code_invalid_one": "That code is not correct. {{count}} attempt left.", + "auth_activate_code_invalid_other": "That code is not correct. {{count}} attempts left.", + "auth_activate_code_expired": "This code has expired or was entered wrong too often. Request a new one.", + "auth_activate_submit": "Create account", + "auth_activate_resend": "Send a new code", + "auth_activate_resend_in": "Send a new code in {{time}}", + "auth_activate_resend_sent": "A new code is on its way. Codes sent earlier no longer work.", + "auth_activate_resend_exhausted": "No more codes can be sent today. Try again tomorrow.", + "auth_activate_none": "This browser has no signup waiting for a code. Sign in with the password or provider you signed up with to get a new code here, or sign up again.", + "auth_activate_gone": "The email address or username was taken while your signup was waiting. Please sign up again.", + "auth_activate_sign_in": "Sign in", + "auth_activate_sign_up": "Sign up", "auth_activate_toast_success": "Account activated", - "auth_activate_credential_required": "To finish activating this account, confirm it is yours.", - "auth_activate_credential_password": "Enter the password you chose when signing up.", - "auth_activate_credential_oauth": "Sign in with the provider you signed up with.", - "auth_activate_credential_not_yours": "Didn't create this account? You can ignore this email. Nothing is activated.", - "auth_activate_password_invalid": "That password is incorrect", - "auth_activate_submit": "Activate account", "auth_forgot_breadcrumb": "Forgot Password", "auth_forgot_title": "Forgot Password", @@ -95,9 +100,8 @@ "auth_login_loading_methods": "Loading available login methods", "auth_login_choose_method": "Login with one of these methods", "auth_login_with_account": "Login with your OpenShock Account", - "auth_login_activation_after_signup": "Your account has been created. We've sent an activation link to your email address. Check your inbox and spam folder.", - "auth_login_activation_pending": "Your account isn't activated yet. We've sent an activation link to your email address. Check your inbox and spam folder. If nothing arrives, try logging in again later to get a new link.", "auth_login_oauth_only": "This account has no password. Sign in with the provider you signed up with.", + "auth_login_not_activated": "This account has not been activated and cannot be activated by signing in. Contact support to have it activated.", "auth_login_oauth_only_with_buttons": "This account has no password. Sign in with the provider you signed up with using the buttons above.", "auth_login_or_continue_with": "Or continue with", "auth_login_username_label": "Username or Email", @@ -109,7 +113,9 @@ "auth_oauth_create_breadcrumb": "Sign Up With {{provider}}", "auth_oauth_create_title": "Sign Up With {{provider}}", "auth_oauth_create_description": "Complete your account details", - "auth_oauth_create_pending": "You already signed up with this account and it is waiting for activation. We sent the activation email again. Used the wrong address? Correct it below and submit to get a new email.", + "auth_oauth_create_pending": "You already started signing up with this account. We sent a new code to the address you entered.", + "auth_oauth_create_pending_enter_code": "Enter code", + "auth_oauth_create_pending_correct": "Wrong address? Correct it below and submit to get a code there instead.", "auth_oauth_create_username_label": "Username", "auth_oauth_create_username_placeholder": "Username", "auth_oauth_create_email_label": "Email", @@ -135,11 +141,8 @@ "auth_reset_toast_success": "Password has been reset", "auth_signup_breadcrumb": "Sign Up", - "auth_signup_toast_created_mail": "Account created successfully. Please check your email to verify your account.", "auth_signup_toast_created_no_mail": "Account created successfully. You can log in now.", "auth_signup_dialog_title": "Welcome! Thank you for signing up! ❤️", - "auth_signup_dialog_created_mail": "Your account has been created. 🎉 Please check your email to verify your account.", - "auth_signup_dialog_verify_then_login": "After verifying your email, you can log in to your account.", "auth_signup_dialog_created_no_mail": "Your account has been created and is ready to use. 🎉", "auth_signup_dialog_login_now": "You can log in to your account now.", "auth_signup_title": "Create your account", @@ -956,10 +959,6 @@ "report_submit": "Submit Report", "turnstile_disabled": "Turnstile disabled", "common_internal_error": "Internal error", - "resend_toast_sent": "Activation email sent. Check your inbox and spam folder.", - "resend_toast_throttled": "Too many activation emails have been requested. Please try again later.", - "resend_toast_unavailable": "No activation email can be resent from this browser. If your account isn't activated yet, logging in sends a new link.", - "resend_button": "Didn't get the email? Resend", "expiration_label": "Expiration", "expiration_never": "Never", "expiration_custom": "Custom", @@ -1000,13 +999,16 @@ "terminal_toast_app_mode_failed": "Failed to enter application mode: {{error}}", "problem_account_account_not_activated_title": "Account not activated", - "problem_account_account_not_activated_desc": "Check your inbox for the activation email.", - "problem_account_activation_not_found_title": "Activation link is invalid", - "problem_account_activation_not_found_desc": "The link may have expired or already been used.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Too many activation emails requested", "problem_account_activation_resend_too_many_desc": "Please wait a while before trying again.", - "problem_account_activation_resend_unavailable_title": "Cannot resend activation email", - "problem_account_activation_resend_unavailable_desc": "Log in again to request a new activation link.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Account is already deactivated", "problem_account_deactivate_denied_privileged_title": "Privileged accounts cannot be deactivated", "problem_account_deactivate_unauthorized_title": "You are not allowed to do this", @@ -1046,6 +1048,7 @@ "problem_authentication_session_invalid_desc": "Please log in again.", "problem_authentication_token_invalid_title": "Invalid API token", "problem_authentication_unknown_error_title": "Authentication failed", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "You do not have permission to do this", "problem_authorization_token_only_title": "This action requires an API token", "problem_authorization_token_permission_missing_title": "This API token is missing a required permission", diff --git a/messages/es.json b/messages/es.json index 633c410b..074cd164 100644 --- a/messages/es.json +++ b/messages/es.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Activar cuenta", "auth_activate_title": "Activar cuenta", - "auth_activate_activating": "Activando tu cuenta...", - "auth_activate_success": "Tu cuenta se ha activado", - "auth_activate_failed": "Este enlace de activación no es válido o ha caducado", - "auth_activate_missing_token": "Falta el token de activación", - "auth_activate_continue": "Continuar al inicio de sesión", "auth_activate_toast_success": "Cuenta activada", "auth_forgot_breadcrumb": "Contraseña olvidada", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Cargando los métodos de inicio de sesión disponibles", "auth_login_choose_method": "Inicia sesión con uno de estos métodos", "auth_login_with_account": "Inicia sesión con tu cuenta de OpenShock", - "auth_login_activation_after_signup": "Tu cuenta se ha creado. Te hemos enviado un enlace de activación a tu correo electrónico. Revisa tu bandeja de entrada y la carpeta de spam.", - "auth_login_activation_pending": "Tu cuenta aún no está activada. Te hemos enviado un enlace de activación a tu correo electrónico. Revisa tu bandeja de entrada y la carpeta de spam. Si no te llega nada, vuelve a iniciar sesión más tarde para recibir un enlace nuevo.", "auth_login_oauth_only": "Esta cuenta no tiene contraseña. Inicia sesión con el proveedor con el que te registraste.", "auth_login_oauth_only_with_buttons": "Esta cuenta no tiene contraseña. Inicia sesión con el proveedor con el que te registraste usando los botones de arriba.", "auth_login_or_continue_with": "O continúa con", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Se ha restablecido la contraseña", "auth_signup_breadcrumb": "Registrarse", - "auth_signup_toast_created_mail": "Cuenta creada correctamente. Revisa tu correo electrónico para verificar tu cuenta.", "auth_signup_toast_created_no_mail": "Cuenta creada correctamente. Ya puedes iniciar sesión.", "auth_signup_dialog_title": "¡Te damos la bienvenida! ¡Gracias por registrarte! ❤️", - "auth_signup_dialog_created_mail": "Tu cuenta se ha creado. 🎉 Revisa tu correo electrónico para verificar tu cuenta.", - "auth_signup_dialog_verify_then_login": "Cuando hayas verificado tu correo electrónico, podrás iniciar sesión en tu cuenta.", "auth_signup_dialog_created_no_mail": "Tu cuenta se ha creado y ya está lista para usarse. 🎉", "auth_signup_dialog_login_now": "Ya puedes iniciar sesión en tu cuenta.", "auth_signup_title": "Crea tu cuenta", @@ -906,10 +896,6 @@ "report_submit": "Enviar denuncia", "turnstile_disabled": "Turnstile desactivado", "common_internal_error": "Error interno", - "resend_toast_sent": "Correo de activación enviado. Revisa tu bandeja de entrada y la carpeta de spam.", - "resend_toast_throttled": "Se han solicitado demasiados correos de activación. Inténtalo más tarde.", - "resend_toast_unavailable": "No se puede reenviar el correo de activación desde este navegador. Si tu cuenta aún no está activada, al iniciar sesión se envía un nuevo enlace.", - "resend_button": "¿No recibiste el correo? Reenviar", "expiration_label": "Caducidad", "expiration_never": "Nunca", "expiration_custom": "Personalizado", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "No se pudo entrar en el modo de aplicación: {{error}}", "problem_account_account_not_activated_title": "Cuenta no activada", - "problem_account_account_not_activated_desc": "Busca el correo de activación en tu bandeja de entrada.", - "problem_account_activation_not_found_title": "El enlace de activación no es válido", - "problem_account_activation_not_found_desc": "Puede que el enlace haya caducado o ya se haya usado.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Se han solicitado demasiados correos de activación", "problem_account_activation_resend_too_many_desc": "Espera un rato antes de volver a intentarlo.", - "problem_account_activation_resend_unavailable_title": "No se puede reenviar el correo de activación", - "problem_account_activation_resend_unavailable_desc": "Vuelve a iniciar sesión para pedir un nuevo enlace de activación.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "La cuenta ya está desactivada", "problem_account_deactivate_denied_privileged_title": "Las cuentas privilegiadas no se pueden desactivar", "problem_account_deactivate_unauthorized_title": "No tienes permiso para hacer esto", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Vuelve a iniciar sesión.", "problem_authentication_token_invalid_title": "Token de API no válido", "problem_authentication_unknown_error_title": "Error de autenticación", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "No tienes permiso para hacer esto", "problem_authorization_token_only_title": "Esta acción requiere un token de API", "problem_authorization_token_permission_missing_title": "A este token de API le falta un permiso necesario", diff --git a/messages/et.json b/messages/et.json index 82bb3d65..fa031af6 100644 --- a/messages/et.json +++ b/messages/et.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Konto aktiveerimine", "auth_activate_title": "Konto aktiveerimine", - "auth_activate_activating": "Sinu kontot aktiveeritakse...", - "auth_activate_success": "Sinu konto on aktiveeritud", - "auth_activate_failed": "See aktiveerimislink on kehtetu või aegunud", - "auth_activate_missing_token": "Aktiveerimisvõti puudub", - "auth_activate_continue": "Jätka sisselogimisega", "auth_activate_toast_success": "Konto on aktiveeritud", "auth_forgot_breadcrumb": "Unustatud parool", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Saadaolevate sisselogimisviiside laadimine", "auth_login_choose_method": "Logi sisse ühega neist viisidest", "auth_login_with_account": "Logi sisse oma OpenShocki kontoga", - "auth_login_activation_after_signup": "Sinu konto on loodud. Saatsime aktiveerimislingi sinu e-posti aadressile. Kontrolli postkasti ja rämpsposti kausta.", - "auth_login_activation_pending": "Sinu konto pole veel aktiveeritud. Saatsime aktiveerimislingi sinu e-posti aadressile. Kontrolli postkasti ja rämpsposti kausta. Kui midagi ei saabu, proovi hiljem uuesti sisse logida, et saada uus link.", "auth_login_oauth_only": "Sellel kontol pole parooli. Logi sisse teenusepakkujaga, millega registreerusid.", "auth_login_oauth_only_with_buttons": "Sellel kontol pole parooli. Logi ülal olevate nuppude abil sisse teenusepakkujaga, millega registreerusid.", "auth_login_or_continue_with": "Või jätka teenusega", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Parool on lähtestatud", "auth_signup_breadcrumb": "Registreerumine", - "auth_signup_toast_created_mail": "Konto loodi edukalt. Konto kinnitamiseks vaata oma e-posti.", "auth_signup_toast_created_no_mail": "Konto loodi edukalt. Võid nüüd sisse logida.", "auth_signup_dialog_title": "Tere tulemast! Aitäh, et registreerusid! ❤️", - "auth_signup_dialog_created_mail": "Sinu konto on loodud. 🎉 Konto kinnitamiseks vaata oma e-posti.", - "auth_signup_dialog_verify_then_login": "Pärast e-posti aadressi kinnitamist saad oma kontole sisse logida.", "auth_signup_dialog_created_no_mail": "Sinu konto on loodud ja kasutusvalmis. 🎉", "auth_signup_dialog_login_now": "Võid nüüd oma kontole sisse logida.", "auth_signup_title": "Loo konto", @@ -906,10 +896,6 @@ "report_submit": "Saada teade", "turnstile_disabled": "Turnstile on keelatud", "common_internal_error": "Sisemine viga", - "resend_toast_sent": "Aktiveerimismeil saadeti. Vaata postkasti ja rämpsposti kausta.", - "resend_toast_throttled": "Liiga palju aktiveerimismeile on küsitud. Proovi hiljem uuesti.", - "resend_toast_unavailable": "Sellest brauserist ei saa aktiveerimismeili uuesti saata. Kui sinu konto pole veel aktiveeritud, saadab sisselogimine uue lingi.", - "resend_button": "Meili ei tulnud? Saada uuesti", "expiration_label": "Aegumine", "expiration_never": "Mitte kunagi", "expiration_custom": "Kohandatud", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Rakendusrežiimi sisenemine ebaõnnestus: {{error}}", "problem_account_account_not_activated_title": "Konto pole aktiveeritud", - "problem_account_account_not_activated_desc": "Otsi aktiveerimismeili oma postkastist.", - "problem_account_activation_not_found_title": "Aktiveerimislink on vigane", - "problem_account_activation_not_found_desc": "Link võib olla aegunud või juba kasutatud.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Liiga palju aktiveerimismeile küsitud", "problem_account_activation_resend_too_many_desc": "Oota natuke, enne kui uuesti proovid.", - "problem_account_activation_resend_unavailable_title": "Aktiveerimismeili ei saa uuesti saata", - "problem_account_activation_resend_unavailable_desc": "Uue aktiveerimislingi saamiseks logi uuesti sisse.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Konto on juba deaktiveeritud", "problem_account_deactivate_denied_privileged_title": "Privilegeeritud kontosid ei saa deaktiveerida", "problem_account_deactivate_unauthorized_title": "Sul pole lubatud seda teha", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Palun logi uuesti sisse.", "problem_authentication_token_invalid_title": "Vigane API-tõend", "problem_authentication_unknown_error_title": "Autentimine ebaõnnestus", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Sul pole selleks õigust", "problem_authorization_token_only_title": "See toiming nõuab API-tõendit", "problem_authorization_token_permission_missing_title": "Sellel API-tõendil puudub vajalik õigus", diff --git a/messages/fi.json b/messages/fi.json index c4a92839..1bb7caed 100644 --- a/messages/fi.json +++ b/messages/fi.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Aktivoi tili", "auth_activate_title": "Aktivoi tili", - "auth_activate_activating": "Tiliäsi aktivoidaan...", - "auth_activate_success": "Tilisi on aktivoitu", - "auth_activate_failed": "Tämä aktivointilinkki on virheellinen tai vanhentunut", - "auth_activate_missing_token": "Aktivointitunnus puuttuu", - "auth_activate_continue": "Jatka kirjautumiseen", "auth_activate_toast_success": "Tili aktivoitu", "auth_forgot_breadcrumb": "Unohtunut salasana", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Ladataan käytettävissä olevia kirjautumistapoja", "auth_login_choose_method": "Kirjaudu jollakin näistä tavoista", "auth_login_with_account": "Kirjaudu OpenShock-tililläsi", - "auth_login_activation_after_signup": "Tilisi on luotu. Lähetimme aktivointilinkin sähköpostiosoitteeseesi. Tarkista saapuneet viestit ja roskapostikansio.", - "auth_login_activation_pending": "Tiliäsi ei ole vielä aktivoitu. Lähetimme aktivointilinkin sähköpostiosoitteeseesi. Tarkista saapuneet viestit ja roskapostikansio. Jos mitään ei tule, yritä kirjautua myöhemmin uudelleen saadaksesi uuden linkin.", "auth_login_oauth_only": "Tällä tilillä ei ole salasanaa. Kirjaudu sisään palvelulla, jolla rekisteröidyit.", "auth_login_oauth_only_with_buttons": "Tällä tilillä ei ole salasanaa. Kirjaudu sisään yllä olevilla painikkeilla palvelulla, jolla rekisteröidyit.", "auth_login_or_continue_with": "Tai jatka käyttäen", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Salasana on palautettu", "auth_signup_breadcrumb": "Rekisteröidy", - "auth_signup_toast_created_mail": "Tili luotiin onnistuneesti. Vahvista tilisi sähköpostiisi lähetetyllä linkillä.", "auth_signup_toast_created_no_mail": "Tili luotiin onnistuneesti. Voit nyt kirjautua sisään.", "auth_signup_dialog_title": "Tervetuloa! Kiitos rekisteröitymisestä! ❤️", - "auth_signup_dialog_created_mail": "Tilisi on luotu. 🎉 Vahvista tilisi sähköpostiisi lähetetyllä linkillä.", - "auth_signup_dialog_verify_then_login": "Kun olet vahvistanut sähköpostiosoitteesi, voit kirjautua tilillesi.", "auth_signup_dialog_created_no_mail": "Tilisi on luotu ja valmis käytettäväksi. 🎉", "auth_signup_dialog_login_now": "Voit nyt kirjautua tilillesi.", "auth_signup_title": "Luo tili", @@ -906,10 +896,6 @@ "report_submit": "Lähetä ilmoitus", "turnstile_disabled": "Turnstile pois käytöstä", "common_internal_error": "Sisäinen virhe", - "resend_toast_sent": "Aktivointiviesti lähetetty. Tarkista saapuneet ja roskaposti.", - "resend_toast_throttled": "Aktivointiviestejä on pyydetty liian monta. Yritä myöhemmin uudelleen.", - "resend_toast_unavailable": "Aktivointiviestiä ei voi lähettää uudelleen tästä selaimesta. Jos tiliäsi ei ole vielä aktivoitu, kirjautuminen lähettää uuden linkin.", - "resend_button": "Eikö viesti tullut? Lähetä uudelleen", "expiration_label": "Vanheneminen", "expiration_never": "Ei koskaan", "expiration_custom": "Mukautettu", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Sovellustilaan siirtyminen epäonnistui: {{error}}", "problem_account_account_not_activated_title": "Tiliä ei ole aktivoitu", - "problem_account_account_not_activated_desc": "Etsi aktivointiviesti saapuneista.", - "problem_account_activation_not_found_title": "Aktivointilinkki on virheellinen", - "problem_account_activation_not_found_desc": "Linkki on ehkä vanhentunut tai jo käytetty.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Aktivointiviestejä pyydetty liian monta", "problem_account_activation_resend_too_many_desc": "Odota hetki ennen kuin yrität uudelleen.", - "problem_account_activation_resend_unavailable_title": "Aktivointiviestiä ei voi lähettää uudelleen", - "problem_account_activation_resend_unavailable_desc": "Kirjaudu uudelleen pyytääksesi uuden aktivointilinkin.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Tili on jo poistettu käytöstä", "problem_account_deactivate_denied_privileged_title": "Etuoikeutettuja tilejä ei voi poistaa käytöstä", "problem_account_deactivate_unauthorized_title": "Sinulla ei ole lupaa tehdä tätä", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Kirjaudu uudelleen.", "problem_authentication_token_invalid_title": "Virheellinen API-tunniste", "problem_authentication_unknown_error_title": "Tunnistautuminen epäonnistui", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Sinulla ei ole oikeutta tehdä tätä", "problem_authorization_token_only_title": "Tämä toiminto vaatii API-tunnisteen", "problem_authorization_token_permission_missing_title": "Tältä API-tunnisteelta puuttuu vaadittu käyttöoikeus", diff --git a/messages/fr.json b/messages/fr.json index 619f6fb1..4724a6d3 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Activer le compte", "auth_activate_title": "Activer le compte", - "auth_activate_activating": "Activation de votre compte...", - "auth_activate_success": "Votre compte a été activé", - "auth_activate_failed": "Ce lien d'activation est invalide ou a expiré", - "auth_activate_missing_token": "Jeton d'activation manquant", - "auth_activate_continue": "Continuer vers la connexion", "auth_activate_toast_success": "Compte activé", "auth_forgot_breadcrumb": "Mot de passe oublié", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Chargement des méthodes de connexion disponibles", "auth_login_choose_method": "Connectez-vous avec l'une de ces méthodes", "auth_login_with_account": "Connectez-vous avec votre compte OpenShock", - "auth_login_activation_after_signup": "Votre compte a été créé. Nous avons envoyé un lien d'activation à votre adresse e-mail. Vérifiez votre boîte de réception et vos courriers indésirables.", - "auth_login_activation_pending": "Votre compte n'est pas encore activé. Nous avons envoyé un lien d'activation à votre adresse e-mail. Vérifiez votre boîte de réception et vos courriers indésirables. Si vous ne recevez rien, reconnectez-vous plus tard pour obtenir un nouveau lien.", "auth_login_oauth_only": "Ce compte n'a pas de mot de passe. Connectez-vous avec le fournisseur utilisé lors de votre inscription.", "auth_login_oauth_only_with_buttons": "Ce compte n'a pas de mot de passe. Connectez-vous avec le fournisseur utilisé lors de votre inscription à l'aide des boutons ci-dessus.", "auth_login_or_continue_with": "Ou continuer avec", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Le mot de passe a été réinitialisé", "auth_signup_breadcrumb": "Inscription", - "auth_signup_toast_created_mail": "Compte créé avec succès. Consultez vos e-mails pour vérifier votre compte.", "auth_signup_toast_created_no_mail": "Compte créé avec succès. Vous pouvez vous connecter dès maintenant.", "auth_signup_dialog_title": "Bienvenue ! Merci de vous être inscrit ! ❤️", - "auth_signup_dialog_created_mail": "Votre compte a été créé. 🎉 Consultez vos e-mails pour vérifier votre compte.", - "auth_signup_dialog_verify_then_login": "Une fois votre adresse e-mail vérifiée, vous pourrez vous connecter à votre compte.", "auth_signup_dialog_created_no_mail": "Votre compte a été créé et est prêt à l'emploi. 🎉", "auth_signup_dialog_login_now": "Vous pouvez vous connecter à votre compte dès maintenant.", "auth_signup_title": "Créez votre compte", @@ -906,10 +896,6 @@ "report_submit": "Envoyer le signalement", "turnstile_disabled": "Turnstile désactivé", "common_internal_error": "Erreur interne", - "resend_toast_sent": "E-mail d'activation envoyé. Vérifiez votre boîte de réception et vos spams.", - "resend_toast_throttled": "Trop d'e-mails d'activation ont été demandés. Réessayez plus tard.", - "resend_toast_unavailable": "Aucun e-mail d'activation ne peut être renvoyé depuis ce navigateur. Si votre compte n'est pas encore activé, la connexion envoie un nouveau lien.", - "resend_button": "Pas reçu l'e-mail ? Renvoyer", "expiration_label": "Expiration", "expiration_never": "Jamais", "expiration_custom": "Personnalisé", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Impossible de passer en mode application : {{error}}", "problem_account_account_not_activated_title": "Compte non activé", - "problem_account_account_not_activated_desc": "Recherchez l'e-mail d'activation dans votre boîte de réception.", - "problem_account_activation_not_found_title": "Le lien d'activation est invalide", - "problem_account_activation_not_found_desc": "Le lien a peut-être expiré ou a déjà été utilisé.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Trop d'e-mails d'activation demandés", "problem_account_activation_resend_too_many_desc": "Patientez un moment avant de réessayer.", - "problem_account_activation_resend_unavailable_title": "Impossible de renvoyer l'e-mail d'activation", - "problem_account_activation_resend_unavailable_desc": "Reconnectez-vous pour demander un nouveau lien d'activation.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Le compte est déjà désactivé", "problem_account_deactivate_denied_privileged_title": "Les comptes privilégiés ne peuvent pas être désactivés", "problem_account_deactivate_unauthorized_title": "Vous n'êtes pas autorisé à faire cela", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Veuillez vous reconnecter.", "problem_authentication_token_invalid_title": "Jeton d'API invalide", "problem_authentication_unknown_error_title": "Échec de l'authentification", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Vous n'avez pas l'autorisation de faire cela", "problem_authorization_token_only_title": "Cette action nécessite un jeton d'API", "problem_authorization_token_permission_missing_title": "Ce jeton d'API n'a pas une autorisation requise", diff --git a/messages/ja.json b/messages/ja.json index 62ee84df..2a3aa0b5 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "アカウントの有効化", "auth_activate_title": "アカウントの有効化", - "auth_activate_activating": "アカウントを有効化しています...", - "auth_activate_success": "アカウントが有効化されました", - "auth_activate_failed": "この有効化リンクは無効か、期限切れです", - "auth_activate_missing_token": "有効化トークンがありません", - "auth_activate_continue": "ログインへ進む", "auth_activate_toast_success": "アカウントを有効化しました", "auth_forgot_breadcrumb": "パスワードを忘れた場合", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "利用可能なログイン方法を読み込んでいます", "auth_login_choose_method": "次のいずれかの方法でログイン", "auth_login_with_account": "OpenShock アカウントでログイン", - "auth_login_activation_after_signup": "アカウントが作成されました。メールアドレスに有効化リンクを送信しました。受信トレイと迷惑メールフォルダーをご確認ください。", - "auth_login_activation_pending": "アカウントはまだ有効化されていません。メールアドレスに有効化リンクを送信しました。受信トレイと迷惑メールフォルダーをご確認ください。届かない場合は、後でもう一度ログインして新しいリンクを受け取ってください。", "auth_login_oauth_only": "このアカウントにはパスワードがありません。登録時に使用したプロバイダーでログインしてください。", "auth_login_oauth_only_with_buttons": "このアカウントにはパスワードがありません。上のボタンから、登録時に使用したプロバイダーでログインしてください。", "auth_login_or_continue_with": "または次の方法で続行", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "パスワードをリセットしました", "auth_signup_breadcrumb": "新規登録", - "auth_signup_toast_created_mail": "アカウントを作成しました。メールを確認してアカウントを認証してください。", "auth_signup_toast_created_no_mail": "アカウントを作成しました。今すぐログインできます。", "auth_signup_dialog_title": "ようこそ!ご登録ありがとうございます!❤️", - "auth_signup_dialog_created_mail": "アカウントが作成されました。🎉 メールを確認してアカウントを認証してください。", - "auth_signup_dialog_verify_then_login": "メールアドレスの認証後、アカウントにログインできます。", "auth_signup_dialog_created_no_mail": "アカウントが作成され、すぐにご利用いただけます。🎉", "auth_signup_dialog_login_now": "今すぐアカウントにログインできます。", "auth_signup_title": "アカウントを作成", @@ -902,10 +892,6 @@ "report_submit": "報告を送信", "turnstile_disabled": "Turnstile は無効です", "common_internal_error": "内部エラー", - "resend_toast_sent": "有効化メールを送信しました。受信トレイと迷惑メールフォルダーをご確認ください。", - "resend_toast_throttled": "有効化メールのリクエストが多すぎます。しばらくしてからもう一度お試しください。", - "resend_toast_unavailable": "このブラウザーからは有効化メールを再送信できません。アカウントがまだ有効化されていない場合は、ログインすると新しいリンクが送信されます。", - "resend_button": "メールが届きませんか?再送信", "expiration_label": "有効期限", "expiration_never": "なし", "expiration_custom": "カスタム", @@ -945,13 +931,16 @@ "terminal_toast_app_mode_failed": "アプリケーションモードに入れませんでした: {{error}}", "problem_account_account_not_activated_title": "アカウントが有効化されていません", - "problem_account_account_not_activated_desc": "受信トレイで有効化メールをご確認ください。", - "problem_account_activation_not_found_title": "有効化リンクが無効です", - "problem_account_activation_not_found_desc": "リンクの期限が切れているか、すでに使用されている可能性があります。", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "有効化メールのリクエストが多すぎます", "problem_account_activation_resend_too_many_desc": "しばらく待ってからもう一度お試しください。", - "problem_account_activation_resend_unavailable_title": "有効化メールを再送信できません", - "problem_account_activation_resend_unavailable_desc": "もう一度ログインして、新しい有効化リンクをリクエストしてください。", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "アカウントはすでに無効化されています", "problem_account_deactivate_denied_privileged_title": "特権アカウントは無効化できません", "problem_account_deactivate_unauthorized_title": "この操作は許可されていません", @@ -991,6 +980,7 @@ "problem_authentication_session_invalid_desc": "もう一度ログインしてください。", "problem_authentication_token_invalid_title": "無効な API トークンです", "problem_authentication_unknown_error_title": "認証に失敗しました", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "この操作を行う権限がありません", "problem_authorization_token_only_title": "この操作には API トークンが必要です", "problem_authorization_token_permission_missing_title": "この API トークンには必要な権限がありません", diff --git a/messages/nb.json b/messages/nb.json index 8555f47c..e38e3015 100644 --- a/messages/nb.json +++ b/messages/nb.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Aktiver konto", "auth_activate_title": "Aktiver konto", - "auth_activate_activating": "Aktiverer kontoen din...", - "auth_activate_success": "Kontoen din er aktivert", - "auth_activate_failed": "Denne aktiveringslenken er ugyldig eller utløpt", - "auth_activate_missing_token": "Aktiveringstoken mangler", - "auth_activate_continue": "Fortsett til innlogging", "auth_activate_toast_success": "Kontoen er aktivert", "auth_forgot_breadcrumb": "Glemt passord", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Laster inn tilgjengelige innloggingsmetoder", "auth_login_choose_method": "Logg inn med en av disse metodene", "auth_login_with_account": "Logg inn med OpenShock-kontoen din", - "auth_login_activation_after_signup": "Kontoen din er opprettet. Vi har sendt en aktiveringslenke til e-postadressen din. Sjekk innboksen og søppelpost.", - "auth_login_activation_pending": "Kontoen din er ikke aktivert ennå. Vi har sendt en aktiveringslenke til e-postadressen din. Sjekk innboksen og søppelpost. Hvis e-posten ikke kommer, kan du prøve å logge inn igjen senere for å få en ny lenke.", "auth_login_oauth_only": "Denne kontoen har ikke noe passord. Logg inn med leverandøren du registrerte deg med.", "auth_login_oauth_only_with_buttons": "Denne kontoen har ikke noe passord. Logg inn med leverandøren du registrerte deg med ved å bruke knappene over.", "auth_login_or_continue_with": "Eller fortsett med", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Passordet er tilbakestilt", "auth_signup_breadcrumb": "Registrer deg", - "auth_signup_toast_created_mail": "Kontoen er opprettet. Sjekk e-posten din for å bekrefte kontoen.", "auth_signup_toast_created_no_mail": "Kontoen er opprettet. Du kan logge inn nå.", "auth_signup_dialog_title": "Velkommen! Takk for at du registrerte deg! ❤️", - "auth_signup_dialog_created_mail": "Kontoen din er opprettet. 🎉 Sjekk e-posten din for å bekrefte kontoen.", - "auth_signup_dialog_verify_then_login": "Når du har bekreftet e-postadressen, kan du logge inn på kontoen din.", "auth_signup_dialog_created_no_mail": "Kontoen din er opprettet og klar til bruk. 🎉", "auth_signup_dialog_login_now": "Du kan logge inn på kontoen din nå.", "auth_signup_title": "Opprett konto", @@ -906,10 +896,6 @@ "report_submit": "Send rapport", "turnstile_disabled": "Turnstile er deaktivert", "common_internal_error": "Intern feil", - "resend_toast_sent": "Aktiveringslenken er sendt på e-post. Sjekk innboksen og søppelpost.", - "resend_toast_throttled": "For mange forespørsler om aktiveringslenke. Prøv igjen senere.", - "resend_toast_unavailable": "Vi kan ikke sende aktiveringslenken på nytt fra denne nettleseren. Hvis kontoen ikke er aktivert ennå, får du en ny lenke når du prøver å logge inn.", - "resend_button": "Fikk du ikke e-posten? Send på nytt", "expiration_label": "Utløp", "expiration_never": "Aldri", "expiration_custom": "Egendefinert", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Kunne ikke starte enhetens firmware: {{error}}", "problem_account_account_not_activated_title": "Kontoen er ikke aktivert", - "problem_account_account_not_activated_desc": "Sjekk innboksen din for e-posten med aktiveringslenken.", - "problem_account_activation_not_found_title": "Aktiveringslenken er ugyldig", - "problem_account_activation_not_found_desc": "Lenken kan ha utløpt eller allerede blitt brukt.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "For mange forespørsler om aktiveringslenke", "problem_account_activation_resend_too_many_desc": "Vent en stund før du prøver igjen.", - "problem_account_activation_resend_unavailable_title": "Kan ikke sende aktiveringse-posten på nytt", - "problem_account_activation_resend_unavailable_desc": "Logg inn på nytt for å be om en ny aktiveringslenke.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Kontoen er allerede deaktivert", "problem_account_deactivate_denied_privileged_title": "Kontoer med utvidede rettigheter kan ikke deaktiveres", "problem_account_deactivate_unauthorized_title": "Du har ikke tillatelse til å gjøre dette", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Logg inn på nytt.", "problem_authentication_token_invalid_title": "Ugyldig API-token", "problem_authentication_unknown_error_title": "Autentisering mislyktes", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Du har ikke tillatelse til å gjøre dette", "problem_authorization_token_only_title": "Denne handlingen krever et API-token", "problem_authorization_token_permission_missing_title": "Dette API-tokenet mangler nødvendig tilgang", diff --git a/messages/nl.json b/messages/nl.json index 20eb84cb..ce60e7dd 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Account activeren", "auth_activate_title": "Account activeren", - "auth_activate_activating": "Je account wordt geactiveerd...", - "auth_activate_success": "Je account is geactiveerd", - "auth_activate_failed": "Deze activatielink is ongeldig of verlopen", - "auth_activate_missing_token": "Activatietoken ontbreekt", - "auth_activate_continue": "Door naar inloggen", "auth_activate_toast_success": "Account geactiveerd", "auth_forgot_breadcrumb": "Wachtwoord vergeten", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Beschikbare inlogmethoden laden", "auth_login_choose_method": "Log in met een van deze methoden", "auth_login_with_account": "Log in met je OpenShock-account", - "auth_login_activation_after_signup": "Je account is aangemaakt. We hebben een activatielink naar je e-mailadres gestuurd. Kijk in je inbox en spammap.", - "auth_login_activation_pending": "Je account is nog niet geactiveerd. We hebben een activatielink naar je e-mailadres gestuurd. Kijk in je inbox en spammap. Komt er niets aan, log dan later opnieuw in om een nieuwe link te krijgen.", "auth_login_oauth_only": "Dit account heeft geen wachtwoord. Log in met de provider waarmee je je hebt geregistreerd.", "auth_login_oauth_only_with_buttons": "Dit account heeft geen wachtwoord. Log via de knoppen hierboven in met de provider waarmee je je hebt geregistreerd.", "auth_login_or_continue_with": "Of ga verder met", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Wachtwoord is gereset", "auth_signup_breadcrumb": "Registreren", - "auth_signup_toast_created_mail": "Account aangemaakt. Controleer je e-mail om je account te verifiëren.", "auth_signup_toast_created_no_mail": "Account aangemaakt. Je kunt nu inloggen.", "auth_signup_dialog_title": "Welkom! Bedankt voor je registratie! ❤️", - "auth_signup_dialog_created_mail": "Je account is aangemaakt. 🎉 Controleer je e-mail om je account te verifiëren.", - "auth_signup_dialog_verify_then_login": "Nadat je je e-mailadres hebt geverifieerd, kun je inloggen.", "auth_signup_dialog_created_no_mail": "Je account is aangemaakt en klaar voor gebruik. 🎉", "auth_signup_dialog_login_now": "Je kunt nu inloggen.", "auth_signup_title": "Account aanmaken", @@ -906,10 +896,6 @@ "report_submit": "Melding versturen", "turnstile_disabled": "Turnstile uitgeschakeld", "common_internal_error": "Interne fout", - "resend_toast_sent": "Activatiemail verstuurd. Kijk in je inbox en spammap.", - "resend_toast_throttled": "Er zijn te veel activatiemails aangevraagd. Probeer het later opnieuw.", - "resend_toast_unavailable": "Vanuit deze browser kan geen activatiemail opnieuw worden verstuurd. Is je account nog niet geactiveerd, dan stuurt inloggen een nieuwe link.", - "resend_button": "Geen e-mail ontvangen? Opnieuw sturen", "expiration_label": "Vervaldatum", "expiration_never": "Nooit", "expiration_custom": "Aangepast", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Applicatiemodus starten mislukt: {{error}}", "problem_account_account_not_activated_title": "Account niet geactiveerd", - "problem_account_account_not_activated_desc": "Kijk in je inbox voor de activatiemail.", - "problem_account_activation_not_found_title": "Activatielink is ongeldig", - "problem_account_activation_not_found_desc": "De link is mogelijk verlopen of al gebruikt.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Te veel activatiemails aangevraagd", "problem_account_activation_resend_too_many_desc": "Wacht even voordat je het opnieuw probeert.", - "problem_account_activation_resend_unavailable_title": "Activatiemail kan niet opnieuw worden verstuurd", - "problem_account_activation_resend_unavailable_desc": "Log opnieuw in om een nieuwe activatielink aan te vragen.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Account is al gedeactiveerd", "problem_account_deactivate_denied_privileged_title": "Bevoorrechte accounts kunnen niet worden gedeactiveerd", "problem_account_deactivate_unauthorized_title": "Je mag dit niet doen", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Log opnieuw in.", "problem_authentication_token_invalid_title": "Ongeldig API token", "problem_authentication_unknown_error_title": "Authenticatie mislukt", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Je hebt geen toestemming om dit te doen", "problem_authorization_token_only_title": "Voor deze actie is een API token nodig", "problem_authorization_token_permission_missing_title": "Dit API token mist een vereiste machtiging", diff --git a/messages/sv.json b/messages/sv.json index 746c90a5..a87572a3 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Aktivera konto", "auth_activate_title": "Aktivera konto", - "auth_activate_activating": "Aktiverar ditt konto...", - "auth_activate_success": "Ditt konto har aktiverats", - "auth_activate_failed": "Den här aktiveringslänken är ogiltig eller har gått ut", - "auth_activate_missing_token": "Aktiveringstoken saknas", - "auth_activate_continue": "Fortsätt till inloggningen", "auth_activate_toast_success": "Kontot har aktiverats", "auth_forgot_breadcrumb": "Glömt lösenord", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Läser in tillgängliga inloggningsmetoder", "auth_login_choose_method": "Logga in med någon av dessa metoder", "auth_login_with_account": "Logga in med ditt OpenShock-konto", - "auth_login_activation_after_signup": "Ditt konto har skapats. Vi har skickat en aktiveringslänk till din e-postadress. Kontrollera inkorgen och skräpposten.", - "auth_login_activation_pending": "Ditt konto är inte aktiverat än. Vi har skickat en aktiveringslänk till din e-postadress. Kontrollera inkorgen och skräpposten. Om inget kommer fram kan du försöka logga in igen senare för att få en ny länk.", "auth_login_oauth_only": "Det här kontot har inget lösenord. Logga in med leverantören du registrerade dig med.", "auth_login_oauth_only_with_buttons": "Det här kontot har inget lösenord. Logga in med leverantören du registrerade dig med via knapparna ovan.", "auth_login_or_continue_with": "Eller fortsätt med", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Lösenordet har återställts", "auth_signup_breadcrumb": "Registrera dig", - "auth_signup_toast_created_mail": "Kontot har skapats. Kontrollera din e-post för att verifiera kontot.", "auth_signup_toast_created_no_mail": "Kontot har skapats. Du kan logga in nu.", "auth_signup_dialog_title": "Välkommen! Tack för att du registrerade dig! ❤️", - "auth_signup_dialog_created_mail": "Ditt konto har skapats. 🎉 Kontrollera din e-post för att verifiera kontot.", - "auth_signup_dialog_verify_then_login": "När du har verifierat din e-postadress kan du logga in på ditt konto.", "auth_signup_dialog_created_no_mail": "Ditt konto har skapats och är redo att användas. 🎉", "auth_signup_dialog_login_now": "Du kan logga in på ditt konto nu.", "auth_signup_title": "Skapa ditt konto", @@ -906,10 +896,6 @@ "report_submit": "Skicka rapport", "turnstile_disabled": "Turnstile inaktiverat", "common_internal_error": "Internt fel", - "resend_toast_sent": "Aktiveringsmejl skickat. Kolla inkorgen och skräppostmappen.", - "resend_toast_throttled": "För många aktiveringsmejl har begärts. Försök igen senare.", - "resend_toast_unavailable": "Inget aktiveringsmejl kan skickas igen från den här webbläsaren. Om ditt konto inte är aktiverat än skickar en inloggning en ny länk.", - "resend_button": "Fick du inget mejl? Skicka igen", "expiration_label": "Utgång", "expiration_never": "Aldrig", "expiration_custom": "Anpassad", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Det gick inte att gå in i applikationsläge: {{error}}", "problem_account_account_not_activated_title": "Kontot är inte aktiverat", - "problem_account_account_not_activated_desc": "Leta efter aktiveringsmejlet i din inkorg.", - "problem_account_activation_not_found_title": "Aktiveringslänken är ogiltig", - "problem_account_activation_not_found_desc": "Länken kan ha gått ut eller redan använts.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "För många aktiveringsmejl har begärts", "problem_account_activation_resend_too_many_desc": "Vänta en stund innan du försöker igen.", - "problem_account_activation_resend_unavailable_title": "Det går inte att skicka aktiveringsmejlet igen", - "problem_account_activation_resend_unavailable_desc": "Logga in igen för att begära en ny aktiveringslänk.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Kontot är redan inaktiverat", "problem_account_deactivate_denied_privileged_title": "Privilegierade konton kan inte inaktiveras", "problem_account_deactivate_unauthorized_title": "Du får inte göra detta", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Logga in igen.", "problem_authentication_token_invalid_title": "Ogiltig API-token", "problem_authentication_unknown_error_title": "Autentiseringen misslyckades", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "Du har inte behörighet att göra detta", "problem_authorization_token_only_title": "Den här åtgärden kräver en API-token", "problem_authorization_token_permission_missing_title": "Den här API-token saknar en nödvändig behörighet", diff --git a/messages/uk.json b/messages/uk.json index c83e4d6c..6d95d51b 100644 --- a/messages/uk.json +++ b/messages/uk.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Активація облікового запису", "auth_activate_title": "Активація облікового запису", - "auth_activate_activating": "Активуємо твій обліковий запис...", - "auth_activate_success": "Твій обліковий запис активовано", - "auth_activate_failed": "Це посилання для активації недійсне або застаріло", - "auth_activate_missing_token": "Відсутній токен активації", - "auth_activate_continue": "Перейти до входу", "auth_activate_toast_success": "Обліковий запис активовано", "auth_forgot_breadcrumb": "Забув пароль", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Завантажуємо доступні способи входу", "auth_login_choose_method": "Увійди одним із цих способів", "auth_login_with_account": "Увійди з обліковим записом OpenShock", - "auth_login_activation_after_signup": "Твій обліковий запис створено. Ми надіслали посилання для активації на твою пошту. Перевір вхідні та папку «Спам».", - "auth_login_activation_pending": "Твій обліковий запис ще не активовано. Ми надіслали посилання для активації на твою пошту. Перевір вхідні та папку «Спам». Якщо лист не прийде, спробуй увійти пізніше, щоб отримати нове посилання.", "auth_login_oauth_only": "Цей обліковий запис не має пароля. Увійди через провайдера, з яким реєструвався.", "auth_login_oauth_only_with_buttons": "Цей обліковий запис не має пароля. Увійди через провайдера, з яким реєструвався, за допомогою кнопок вище.", "auth_login_or_continue_with": "Або продовжити через", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Пароль скинуто", "auth_signup_breadcrumb": "Реєстрація", - "auth_signup_toast_created_mail": "Обліковий запис створено. Перевір пошту, щоб підтвердити його.", "auth_signup_toast_created_no_mail": "Обліковий запис створено. Тепер можна увійти.", "auth_signup_dialog_title": "Вітаємо! Дякуємо за реєстрацію! ❤️", - "auth_signup_dialog_created_mail": "Твій обліковий запис створено. 🎉 Перевір пошту, щоб підтвердити його.", - "auth_signup_dialog_verify_then_login": "Після підтвердження пошти ти зможеш увійти у свій обліковий запис.", "auth_signup_dialog_created_no_mail": "Твій обліковий запис створено і він готовий до роботи. 🎉", "auth_signup_dialog_login_now": "Тепер ти можеш увійти у свій обліковий запис.", "auth_signup_title": "Створи обліковий запис", @@ -914,10 +904,6 @@ "report_submit": "Надіслати звіт", "turnstile_disabled": "Turnstile вимкнено", "common_internal_error": "Внутрішня помилка", - "resend_toast_sent": "Лист для активації надіслано. Перевір вхідні та папку «Спам».", - "resend_toast_throttled": "Запитано забагато листів для активації. Спробуй пізніше.", - "resend_toast_unavailable": "З цього браузера не можна повторно надіслати лист для активації. Якщо обліковий запис ще не активовано, увійди, і ми надішлемо нове посилання.", - "resend_button": "Не отримав листа? Надіслати ще", "expiration_label": "Термін дії", "expiration_never": "Ніколи", "expiration_custom": "Свій", @@ -960,13 +946,16 @@ "terminal_toast_app_mode_failed": "Не вдалося увійти в режим застосунку: {{error}}", "problem_account_account_not_activated_title": "Обліковий запис не активовано", - "problem_account_account_not_activated_desc": "Пошукай лист для активації у вхідних.", - "problem_account_activation_not_found_title": "Посилання для активації недійсне", - "problem_account_activation_not_found_desc": "Можливо, посилання застаріло або його вже використано.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "Запитано забагато листів для активації", "problem_account_activation_resend_too_many_desc": "Зачекай трохи, перш ніж пробувати знову.", - "problem_account_activation_resend_unavailable_title": "Не вдалося повторно надіслати лист для активації", - "problem_account_activation_resend_unavailable_desc": "Увійди ще раз, щоб запитати нове посилання для активації.", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "Обліковий запис уже деактивовано", "problem_account_deactivate_denied_privileged_title": "Привілейовані облікові записи не можна деактивувати", "problem_account_deactivate_unauthorized_title": "Тобі не дозволено це робити", @@ -1006,6 +995,7 @@ "problem_authentication_session_invalid_desc": "Увійди ще раз.", "problem_authentication_token_invalid_title": "Недійсний API-токен", "problem_authentication_unknown_error_title": "Помилка автентифікації", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "У тебе немає дозволу на це", "problem_authorization_token_only_title": "Для цієї дії потрібен API-токен", "problem_authorization_token_permission_missing_title": "Цьому API-токену бракує потрібного дозволу", diff --git a/messages/uwu.json b/messages/uwu.json index 6c601cf1..2369c187 100644 --- a/messages/uwu.json +++ b/messages/uwu.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "Wake up account", "auth_activate_title": "Wake up your account~", - "auth_activate_activating": "Waking up your account... *big sleepy stretch*", - "auth_activate_success": "Your account is wide awake! Yay~ ♡", - "auth_activate_failed": "This link is broken or too old... *whimpers*", - "auth_activate_missing_token": "The activation token wandered off somewhere... *pouts*", - "auth_activate_continue": "Onward to login!", "auth_activate_toast_success": "Account activated! *happy tail wags*", "auth_forgot_breadcrumb": "Forgot pawsword", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "Sniffing out ways to log in...", "auth_login_choose_method": "Pick your favorite way to log in~", "auth_login_with_account": "Log in with your OpenShock account", - "auth_login_activation_after_signup": "Your account is ready! I sent a wake-up link to your email. Check your inbox, and peek in the spam folder too~", - "auth_login_activation_pending": "Your account is still sleepy and not activated yet! I sent a wake-up link to your email. Check your inbox and spam folder. If nothing shows up, try logging in again later and I'll send a fresh one!", "auth_login_oauth_only": "This account doesn't have a pawsword! Log in with the service you signed up with~", "auth_login_oauth_only_with_buttons": "This account doesn't have a pawsword! Log in with the service you signed up with, using the buttons up there~", "auth_login_or_continue_with": "Or continue with", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "Pawsword reset! Don't forget it this time, silly~ hehe", "auth_signup_breadcrumb": "Join the pack", - "auth_signup_toast_created_mail": "Yay, account made! Check your email to verify it~", "auth_signup_toast_created_no_mail": "Yay, account made! You can log in right away~", "auth_signup_dialog_title": "Welcome to the pack!! Thank you for joining! ❤️ *nuzzles and twirls*", - "auth_signup_dialog_created_mail": "Your account is made! 🎉 Check your email to verify it~", - "auth_signup_dialog_verify_then_login": "Once your email is verified, you can hop right in!", "auth_signup_dialog_created_no_mail": "Your account is made and ready to go! 🎉 *happy wiggle*", "auth_signup_dialog_login_now": "You can log in right now~", "auth_signup_title": "Join the pack! ♡", @@ -906,10 +896,6 @@ "report_submit": "Send it!", "turnstile_disabled": "Turnstile is napping", "common_internal_error": "Oopsie inside", - "resend_toast_sent": "Sent another lil letter! Check your inbox and spam~", - "resend_toast_throttled": "That's a lot of letters! Wait a bit and try again~", - "resend_toast_unavailable": "Can't resend from this browser! If you're not activated yet, just log in and we'll send a fresh link~", - "resend_button": "No letter? Send another!", "expiration_label": "Goes poof", "expiration_never": "Never", "expiration_custom": "Custom", @@ -950,13 +936,16 @@ "terminal_toast_app_mode_failed": "Couldn't wake the app up: {{error}}", "problem_account_account_not_activated_title": "Account isn't awake yet", - "problem_account_account_not_activated_desc": "Check your inbox for the activation letter~", - "problem_account_activation_not_found_title": "That activation link is silly", - "problem_account_activation_not_found_desc": "It might've gone poof or been used already.", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "That's a lot of activation letters!", "problem_account_activation_resend_too_many_desc": "Take a lil break before trying again~", - "problem_account_activation_resend_unavailable_title": "Can't send another activation letter", - "problem_account_activation_resend_unavailable_desc": "Log in again and we'll send a fresh link~", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "This account is already napping", "problem_account_deactivate_denied_privileged_title": "Special accounts can't go to sleep", "problem_account_deactivate_unauthorized_title": "You're not allowed to do that", @@ -996,6 +985,7 @@ "problem_authentication_session_invalid_desc": "Please log in again~", "problem_authentication_token_invalid_title": "That token is silly", "problem_authentication_unknown_error_title": "Couldn't tell who you are", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "You're not allowed to do that", "problem_authorization_token_only_title": "You need a token for this", "problem_authorization_token_permission_missing_title": "This token is missing a permission", diff --git a/messages/zh-Hans.json b/messages/zh-Hans.json index 5e18a62b..de890d1c 100644 --- a/messages/zh-Hans.json +++ b/messages/zh-Hans.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "激活账号", "auth_activate_title": "激活账号", - "auth_activate_activating": "正在激活你的账号...", - "auth_activate_success": "你的账号已激活", - "auth_activate_failed": "此激活链接无效或已过期", - "auth_activate_missing_token": "缺少激活令牌", - "auth_activate_continue": "继续登录", "auth_activate_toast_success": "账号已激活", "auth_forgot_breadcrumb": "忘记密码", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "正在加载可用的登录方式", "auth_login_choose_method": "使用以下方式之一登录", "auth_login_with_account": "使用你的 OpenShock 账号登录", - "auth_login_activation_after_signup": "你的账号已创建。我们已向你的邮箱发送了激活链接,请检查收件箱和垃圾邮件文件夹。", - "auth_login_activation_pending": "你的账号尚未激活。我们已向你的邮箱发送了激活链接,请检查收件箱和垃圾邮件文件夹。如果没有收到,请稍后再次登录以获取新链接。", "auth_login_oauth_only": "此账号没有密码。请使用注册时所用的服务登录。", "auth_login_oauth_only_with_buttons": "此账号没有密码。请使用上方按钮,通过注册时所用的服务登录。", "auth_login_or_continue_with": "或通过以下方式继续", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "密码已重置", "auth_signup_breadcrumb": "注册", - "auth_signup_toast_created_mail": "账号创建成功。请查收邮件以验证你的账号。", "auth_signup_toast_created_no_mail": "账号创建成功。你现在可以登录了。", "auth_signup_dialog_title": "欢迎!感谢你的注册!❤️", - "auth_signup_dialog_created_mail": "你的账号已创建。🎉 请查收邮件以验证你的账号。", - "auth_signup_dialog_verify_then_login": "验证邮箱后,你就可以登录账号了。", "auth_signup_dialog_created_no_mail": "你的账号已创建,可以开始使用了。🎉", "auth_signup_dialog_login_now": "你现在可以登录账号了。", "auth_signup_title": "创建账号", @@ -902,10 +892,6 @@ "report_submit": "提交举报", "turnstile_disabled": "Turnstile 已禁用", "common_internal_error": "内部错误", - "resend_toast_sent": "激活邮件已发送,请检查收件箱和垃圾邮件文件夹。", - "resend_toast_throttled": "请求的激活邮件过多,请稍后再试。", - "resend_toast_unavailable": "无法从此浏览器重新发送激活邮件。如果你的账号尚未激活,登录时会发送新链接。", - "resend_button": "没收到邮件?重新发送", "expiration_label": "有效期", "expiration_never": "永不", "expiration_custom": "自定义", @@ -945,13 +931,16 @@ "terminal_toast_app_mode_failed": "进入应用模式失败:{{error}}", "problem_account_account_not_activated_title": "账号未激活", - "problem_account_account_not_activated_desc": "请在收件箱中查找激活邮件。", - "problem_account_activation_not_found_title": "激活链接无效", - "problem_account_activation_not_found_desc": "该链接可能已过期或已被使用。", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "请求的激活邮件过多", "problem_account_activation_resend_too_many_desc": "请稍等一段时间后再试。", - "problem_account_activation_resend_unavailable_title": "无法重新发送激活邮件", - "problem_account_activation_resend_unavailable_desc": "请重新登录以获取新的激活链接。", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "账号已停用", "problem_account_deactivate_denied_privileged_title": "特权账号无法停用", "problem_account_deactivate_unauthorized_title": "你无权执行此操作", @@ -991,6 +980,7 @@ "problem_authentication_session_invalid_desc": "请重新登录。", "problem_authentication_token_invalid_title": "API 令牌无效", "problem_authentication_unknown_error_title": "认证失败", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "你无权执行此操作", "problem_authorization_token_only_title": "此操作需要 API 令牌", "problem_authorization_token_permission_missing_title": "此 API 令牌缺少必需的权限", diff --git a/messages/zh-Hant.json b/messages/zh-Hant.json index e1929c4b..9d133007 100644 --- a/messages/zh-Hant.json +++ b/messages/zh-Hant.json @@ -66,11 +66,6 @@ "auth_activate_breadcrumb": "啟用帳號", "auth_activate_title": "啟用帳號", - "auth_activate_activating": "正在啟用你的帳號...", - "auth_activate_success": "你的帳號已啟用", - "auth_activate_failed": "此啟用連結無效或已過期", - "auth_activate_missing_token": "缺少啟用權杖", - "auth_activate_continue": "繼續登入", "auth_activate_toast_success": "帳號已啟用", "auth_forgot_breadcrumb": "忘記密碼", @@ -88,8 +83,6 @@ "auth_login_loading_methods": "正在載入可用的登入方式", "auth_login_choose_method": "使用下列其中一種方式登入", "auth_login_with_account": "使用你的 OpenShock 帳號登入", - "auth_login_activation_after_signup": "你的帳號已建立。我們已將啟用連結寄到你的電子郵件,請檢查收件匣和垃圾郵件資料夾。", - "auth_login_activation_pending": "你的帳號尚未啟用。我們已將啟用連結寄到你的電子郵件,請檢查收件匣和垃圾郵件資料夾。如果沒有收到,請稍後再登入一次以取得新的連結。", "auth_login_oauth_only": "此帳號沒有密碼。請使用註冊時的服務登入。", "auth_login_oauth_only_with_buttons": "此帳號沒有密碼。請使用上方按鈕,以註冊時的服務登入。", "auth_login_or_continue_with": "或使用以下方式繼續", @@ -127,11 +120,8 @@ "auth_reset_toast_success": "密碼已重設", "auth_signup_breadcrumb": "註冊", - "auth_signup_toast_created_mail": "帳號建立成功。請檢查你的電子郵件以驗證帳號。", "auth_signup_toast_created_no_mail": "帳號建立成功。你現在可以登入了。", "auth_signup_dialog_title": "歡迎!感謝你的註冊!❤️", - "auth_signup_dialog_created_mail": "你的帳號已建立。🎉 請檢查你的電子郵件以驗證帳號。", - "auth_signup_dialog_verify_then_login": "驗證電子郵件後,即可登入你的帳號。", "auth_signup_dialog_created_no_mail": "你的帳號已建立,可以開始使用了。🎉", "auth_signup_dialog_login_now": "你現在可以登入你的帳號了。", "auth_signup_title": "建立你的帳號", @@ -902,10 +892,6 @@ "report_submit": "送出回報", "turnstile_disabled": "Turnstile 已停用", "common_internal_error": "內部錯誤", - "resend_toast_sent": "已寄出啟用信,請檢查收件匣和垃圾郵件資料夾。", - "resend_toast_throttled": "要求的啟用信次數過多,請稍後再試。", - "resend_toast_unavailable": "無法從此瀏覽器重新寄送啟用信。如果你的帳號尚未啟用,登入時會寄送新的連結。", - "resend_button": "沒收到信嗎?重新寄送", "expiration_label": "到期時間", "expiration_never": "永不", "expiration_custom": "自訂", @@ -945,13 +931,16 @@ "terminal_toast_app_mode_failed": "無法進入應用程式模式:{{error}}", "problem_account_account_not_activated_title": "帳號尚未啟用", - "problem_account_account_not_activated_desc": "請檢查收件匣中的啟用信。", - "problem_account_activation_not_found_title": "啟用連結無效", - "problem_account_activation_not_found_desc": "連結可能已過期或已被使用。", + "problem_account_account_not_activated_desc": "Check your inbox for the activation code.", + "problem_account_activation_code_expired_title": "The activation code has expired", + "problem_account_activation_code_expired_desc": "Request a new one.", + "problem_account_activation_code_invalid_title": "The activation code is not correct", + "problem_account_activation_not_found_title": "No signup is waiting in this browser", + "problem_account_activation_not_found_desc": "Sign in with what you signed up with to get a new code, or sign up again.", "problem_account_activation_resend_too_many_title": "要求的啟用信次數過多", "problem_account_activation_resend_too_many_desc": "請稍候一段時間再試。", - "problem_account_activation_resend_unavailable_title": "無法重新寄送啟用信", - "problem_account_activation_resend_unavailable_desc": "請重新登入以要求新的啟用連結。", + "problem_account_activation_resend_unavailable_title": "Cannot send a new activation code", + "problem_account_activation_resend_unavailable_desc": "Sign in with what you signed up with to get a new code.", "problem_account_deactivate_already_deactivated_title": "帳號已停用", "problem_account_deactivate_denied_privileged_title": "無法停用特權帳號", "problem_account_deactivate_unauthorized_title": "你沒有權限執行此操作", @@ -991,6 +980,7 @@ "problem_authentication_session_invalid_desc": "請重新登入。", "problem_authentication_token_invalid_title": "API 權杖無效", "problem_authentication_unknown_error_title": "驗證失敗", + "problem_authorization_origin_not_trusted_title": "This action cannot be done from this website", "problem_authorization_policy_not_met_title": "你沒有權限執行此操作", "problem_authorization_token_only_title": "此操作需要 API 權杖", "problem_authorization_token_permission_missing_title": "此 API 權杖缺少必要的權限", diff --git a/src/lib/api/next/account.ts b/src/lib/api/next/account.ts deleted file mode 100644 index 452bd4c9..00000000 --- a/src/lib/api/next/account.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { getBackendURL } from '#lib/utils/url.js'; -import { ResponseError } from './ResponseError'; - -/** Set by the API on signup while the account awaits activation; removed on login or once activated. */ -export const ACTIVATION_RESEND_COOKIE = 'openShockActivationResend'; - -/** - * Whether this browser can ask for the activation email again. Presence only: the API still decides whether - * the cookie is valid (it may have expired, or the account may have been activated elsewhere). - */ -export function hasActivationResendCookie(): boolean { - if (typeof document === 'undefined') return false; - return document.cookie - .split(';') - .some((c) => c.trimStart().startsWith(`${ACTIVATION_RESEND_COOKIE}=`)); -} - -export type ResendActivationResult = 'sent' | 'throttled' | 'unavailable'; - -/** - * Asks the API to resend the activation email for the account this browser just signed up. The account is - * identified by the cookie the API set on signup, so there is no body. - * - * - `sent`: a new activation email was enqueued. - * - `throttled`: one was sent too recently (one per 10 minutes, five per day). - * - `unavailable`: no pending activation for this browser (cookie missing/expired, or already activated). - */ -export async function ResendActivationEmail(): Promise { - const url = getBackendURL('1/account/activate/resend'); - - const res = await fetch(url, { - method: 'POST', - headers: { accept: 'application/json' }, - credentials: 'include', - redirect: 'error', - }); - - if (res.ok) return 'sent'; - if (res.status === 429) return 'throttled'; - if (res.status === 400) return 'unavailable'; - - // handleApiError reads problem details from `body`, so parse it here. - // A non-JSON body leaves it undefined. - const body: unknown = await res.json().catch(() => undefined); - throw new ResponseError(res, `Unexpected status ${res.status} for POST ${url}`, body); -} - -export type VerifyEmailChangeResult = 'verified' | 'invalid' | 'in-use'; - -/** - * Confirms a pending email change. The API only accepts the token from a signed-in session of the account - * that requested the change, so this is only called from the signed-in part of the app. - */ -export async function VerifyEmailChange(token: string): Promise { - const url = getBackendURL('1/account/email-change/verify'); - url.searchParams.set('token', token); - - const res = await fetch(url, { - method: 'POST', - headers: { accept: 'application/json' }, - credentials: 'include', - redirect: 'error', - }); - - if (res.ok) return 'verified'; - if (res.status === 400) return 'invalid'; - if (res.status === 409) return 'in-use'; - - const body: unknown = await res.json().catch(() => undefined); - throw new ResponseError(res, `Unexpected status ${res.status} for POST ${url}`, body); -} - -export type ActivateAccountResult = - | { status: 'activated' } - | { status: 'invalid' } - | { - /** - * The link is valid, but this is not the browser that signed up, so the API also wants proof the - * account is the visitor's: its password, or a sign-in with one of the linked providers. - */ - status: 'credential-required'; - hasPassword: boolean; - oauthProviders: string[]; - passwordInvalid: boolean; - }; - -/** - * Activates the account an emailed activation token belongs to. In the browser that signed up the token is - * enough (the API recognizes it by a cookie); anywhere else the API answers `credential-required` first. - */ -export async function ActivateAccount( - token: string, - password?: string -): Promise { - const url = getBackendURL('1/account/activate'); - url.searchParams.set('token', token); - - const res = await fetch(url, { - method: 'POST', - headers: { 'content-type': 'application/json', accept: 'application/json' }, - body: JSON.stringify(password ? { password } : {}), - credentials: 'include', - redirect: 'error', - }); - - if (res.ok) return { status: 'activated' }; - if (res.status === 400) return { status: 'invalid' }; - - const body: unknown = await res.json().catch(() => undefined); - if ( - res.status === 403 && - isRecord(body) && - body.type === 'Account.Activation.CredentialRequired' - ) { - return { - status: 'credential-required', - hasPassword: body.hasPassword === true, - oauthProviders: Array.isArray(body.oauthProviders) - ? body.oauthProviders.filter((p): p is string => typeof p === 'string') - : [], - passwordInvalid: body.passwordInvalid === true, - }; - } - - throw new ResponseError(res, `Unexpected status ${res.status} for POST ${url}`, body); -} - -function isRecord(value: unknown): value is Record { - return typeof value === 'object' && value !== null; -} diff --git a/src/lib/api/next/oauth.ts b/src/lib/api/next/oauth.ts index 191cc5fb..deda81a0 100644 --- a/src/lib/api/next/oauth.ts +++ b/src/lib/api/next/oauth.ts @@ -3,19 +3,10 @@ import { GetJson, PostJson } from './base'; import type { LoginOkResponse, OAuthFinalizeRequest, OAuthSignupData } from './models'; import { TransformLoginOkResponse, TransformOAuthSignupData } from './transformers'; -/** - * @param activationToken Token from the activation email. Signing in with the provider linked to a not yet - * activated account then activates it. - */ -export function GetOAuthAuthorizeUrl( - provider: string, - flow: 'LoginOrCreate' | 'Link', - activationToken?: string -): string { +export function GetOAuthAuthorizeUrl(provider: string, flow: 'LoginOrCreate' | 'Link'): string { const url = getBackendURL(`1/oauth/${encodeURIComponent(provider)}/authorize`); url.searchParams.set('flow', flow); - if (activationToken) url.searchParams.set('activationToken', activationToken); return url.href; } diff --git a/src/lib/auth/oauth-errors.ts b/src/lib/auth/oauth-errors.ts index c59927a7..a4c799aa 100644 --- a/src/lib/auth/oauth-errors.ts +++ b/src/lib/auth/oauth-errors.ts @@ -8,7 +8,7 @@ export const OAUTH_ERROR_MESSAGES: Record = { emailAlreadyRegistered: 'An account with this email already exists. Sign in to that account to link this provider.', accountNotActivated: - 'Your account has not been activated yet. Check your inbox for the activation email, then try again.', + 'This account has not been activated and cannot be activated by signing in. Contact support to have it activated.', accountDeactivated: 'This account has been deactivated.', internalError: 'Something went wrong on our end. Please try again in a moment.', unknown: 'Unknown error occurred.', diff --git a/src/lib/components/auth/oauth-buttons.svelte b/src/lib/components/auth/oauth-buttons.svelte index b01c2d7e..d286d8de 100644 --- a/src/lib/components/auth/oauth-buttons.svelte +++ b/src/lib/components/auth/oauth-buttons.svelte @@ -15,17 +15,13 @@ import { GetOAuthAuthorizeUrl } from '#lib/api/next/oauth.js'; import { LogIn } from '@lucide/svelte'; - let { - mode = 'login', - providers, - activationToken, - }: { mode?: 'login' | 'signup'; providers: string[]; activationToken?: string } = $props(); + let { mode = 'login', providers }: { mode?: 'login' | 'signup'; providers: string[] } = $props(); {#each providers as provider (provider)} {@const detail = providerDetails[provider]} - + -{/if} diff --git a/src/lib/errorhandling/apiErrorHandling.ts b/src/lib/errorhandling/apiErrorHandling.ts index 06f1681b..289eaf29 100644 --- a/src/lib/errorhandling/apiErrorHandling.ts +++ b/src/lib/errorhandling/apiErrorHandling.ts @@ -131,15 +131,21 @@ async function handleResponseError(error: ResponseError, handlers: ProblemHandle _onUnauthorized?.(); } - if (error instanceof RateLimitError) { - toast.error(m.error_too_many_requests(), { description: formatRetryAfter(error.retryAfterMs) }); - return; - } - // The HTTP client already consumed and parsed the response body before this // error was constructed, so we read it from `error.body` rather than calling // `response.json()` (which would throw "Body has already been consumed"). const problem = error.body; + + // The API's rate limiter answers in plain text. + // A 429 carrying a known problem type is a domain limit, such as too many activation emails, and is handled like any other problem. + if ( + error instanceof RateLimitError && + !(isProblemDetails(problem) && isKnownProblemType(problem.type)) + ) { + toast.error(m.error_too_many_requests(), { description: formatRetryAfter(error.retryAfterMs) }); + return; + } + if (!isProblemDetails(problem)) { console.error('Content json is not a valid problemdetails object', problem); toast.error(m.error_unexpected_response(), { description: `HTTP ${response.status}` }); diff --git a/src/lib/errorhandling/problemMessages.ts b/src/lib/errorhandling/problemMessages.ts index 1909c963..896e9033 100644 --- a/src/lib/errorhandling/problemMessages.ts +++ b/src/lib/errorhandling/problemMessages.ts @@ -17,6 +17,11 @@ export const ProblemMessages: { title: m.problem_account_account_not_activated_title, description: m.problem_account_account_not_activated_desc, }, + 'Account.Activation.CodeExpired': { + title: m.problem_account_activation_code_expired_title, + description: m.problem_account_activation_code_expired_desc, + }, + 'Account.Activation.CodeInvalid': { title: m.problem_account_activation_code_invalid_title }, 'Account.Activation.NotFound': { title: m.problem_account_activation_not_found_title, description: m.problem_account_activation_not_found_desc, @@ -98,6 +103,7 @@ export const ProblemMessages: { }, 'Authentication.TokenInvalid': { title: m.problem_authentication_token_invalid_title }, 'Authentication.UnknownError': { title: m.problem_authentication_unknown_error_title }, + 'Authorization.Origin.NotTrusted': { title: m.problem_authorization_origin_not_trusted_title }, 'Authorization.Policy.NotMet': { title: m.problem_authorization_policy_not_met_title }, 'Authorization.Token.Only': { title: m.problem_authorization_token_only_title }, 'Authorization.Token.PermissionMissing': { diff --git a/src/lib/errorhandling/problemTypes.ts b/src/lib/errorhandling/problemTypes.ts index 18e1a2f0..c55cec3a 100644 --- a/src/lib/errorhandling/problemTypes.ts +++ b/src/lib/errorhandling/problemTypes.ts @@ -13,19 +13,24 @@ export const ProblemTypes = { // Account 'Account.AccountNotActivated': { title: 'Account not activated', - description: 'Check your inbox for the activation email.', + description: 'Check your inbox for the activation code.', }, + 'Account.Activation.CodeExpired': { + title: 'The activation code has expired', + description: 'Request a new one.', + }, + 'Account.Activation.CodeInvalid': { title: 'The activation code is not correct' }, 'Account.Activation.NotFound': { - title: 'Activation link is invalid', - description: 'The link may have expired or already been used.', + title: 'No signup is waiting in this browser', + description: 'Sign in with what you signed up with to get a new code, or sign up again.', }, 'Account.Activation.ResendTooMany': { title: 'Too many activation emails requested', description: 'Please wait a while before trying again.', }, 'Account.Activation.ResendUnavailable': { - title: 'Cannot resend activation email', - description: 'Log in again to request a new activation link.', + title: 'Cannot send a new activation code', + description: 'Sign in with what you signed up with to get a new code.', }, 'Account.Deactivate.AlreadyDeactivated': { title: 'Account is already deactivated' }, 'Account.Deactivate.DeniedPrivileged': { title: 'Privileged accounts cannot be deactivated' }, @@ -94,6 +99,7 @@ export const ProblemTypes = { 'Authentication.UnknownError': { title: 'Authentication failed' }, // Authorization layer, any authenticated endpoint + 'Authorization.Origin.NotTrusted': { title: 'This action cannot be done from this website' }, 'Authorization.Policy.NotMet': { title: 'You do not have permission to do this' }, 'Authorization.Token.Only': { title: 'This action requires an API token' }, 'Authorization.Token.PermissionMissing': { diff --git a/src/routes/(app)/admin/users/[userId=guid]/+page.svelte b/src/routes/(app)/admin/users/[userId=guid]/+page.svelte index 99626c4d..1ecf71ec 100644 --- a/src/routes/(app)/admin/users/[userId=guid]/+page.svelte +++ b/src/routes/(app)/admin/users/[userId=guid]/+page.svelte @@ -248,18 +248,16 @@ - {:else if user.activationRequest} - {@const request = user.activationRequest} + {:else if user.activatedAt === null}
- Awaiting activation + Not activated - Requested {formatRelativeInstant(request.createdAt, clock.current)}; the activation - mail has been attempted {request.emailSendAttempts} - {request.emailSendAttempts === 1 ? 'time' : 'times'}. + Left unactivated when signups moved to activation codes. This user cannot sign in + until an admin activates the account.
diff --git a/src/routes/(app)/verify-email/+page.svelte b/src/routes/(app)/verify-email/+page.svelte index e595f11f..852945b9 100644 --- a/src/routes/(app)/verify-email/+page.svelte +++ b/src/routes/(app)/verify-email/+page.svelte @@ -1,6 +1,6 @@ diff --git a/src/routes/(auth)/activate/+page.svelte b/src/routes/(auth)/activate/+page.svelte index 94bd9f78..5f6ed04f 100644 --- a/src/routes/(auth)/activate/+page.svelte +++ b/src/routes/(auth)/activate/+page.svelte @@ -1,76 +1,120 @@ @@ -78,51 +122,93 @@

{m.auth_activate_title()}

- {#if status === 'activating'} - {m.auth_activate_activating()} - {:else if status === 'success'} - {m.auth_activate_success()} - {:else if status === 'credential'} - {m.auth_activate_credential_required()} - {:else if status === 'failed'} - {m.auth_activate_failed()} + {#if status === 'loading'} + {m.auth_activate_loading()} + {:else if status === 'ready' && pending} + + {#snippet address({ children })} + {@render children?.()} + {/snippet} + + {:else if status === 'gone'} + {m.auth_activate_gone()} {:else} - {m.auth_activate_missing_token()} + {m.auth_activate_none()} {/if}
- {#if status === 'success'} + {#if status === 'ready' && pending} - - - {:else if status === 'credential'} - - {#if oauthProviders.length > 0} -

{m.auth_activate_credential_oauth()}

- - - {/if} - {#if hasPassword} - -

{m.auth_activate_credential_password()}

- - {#if passwordInvalid} - - {/if} - { + e.preventDefault(); + void submit(); + }} + > + text.replace(/[^a-z0-9]/gi, '')} + bind:value={() => code, (v) => (code = v.toUpperCase())} + onComplete={() => void submit()} + disabled={submitting} + autocomplete="one-time-code" + aria-label={m.auth_activate_code_label()} + aria-invalid={codeError !== null} + autofocus + > + {#snippet children({ cells })} + + {#each cells.slice(0, GROUP_LENGTH) as cell, i (i)} + + {/each} + + + + {#each cells.slice(GROUP_LENGTH) as cell, i (i)} + + {/each} + + {/snippet} + + + {#if codeError} + + {:else} +

{m.auth_activate_code_hint()}

+ {/if} + + + + {#if pending.resendsRemaining <= 0} +

+ {m.auth_activate_resend_exhausted()} +

+ {:else} + + {/if} + +
+ {:else if status === 'none' || status === 'gone'} + + + {#if status === 'none'} + {/if} -

- {m.auth_activate_credential_not_yours()} -

{/if} diff --git a/src/routes/(auth)/login/+page.svelte b/src/routes/(auth)/login/+page.svelte index 7190fe45..9fa31e24 100644 --- a/src/routes/(auth)/login/+page.svelte +++ b/src/routes/(auth)/login/+page.svelte @@ -1,5 +1,6 @@