From f50260c19796a9d5517d90ea7fd103edad81dc18 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 26 Sep 2023 16:04:21 -0700 Subject: [PATCH 1/5] feat: add email verification --- package.json | 8 +- src/lib/auth.ts | 19 +++- src/routes/verify_email/[token]/+error.svelte | 15 +++ src/routes/verify_email/[token]/+page.svelte | 24 +++++ src/routes/verify_email/[token]/+page.ts | 8 ++ yarn.lock | 91 +++++++++++-------- 6 files changed, 123 insertions(+), 42 deletions(-) create mode 100644 src/routes/verify_email/[token]/+error.svelte create mode 100644 src/routes/verify_email/[token]/+page.svelte create mode 100644 src/routes/verify_email/[token]/+page.ts diff --git a/package.json b/package.json index b5b0228d..a6a69429 100644 --- a/package.json +++ b/package.json @@ -19,19 +19,20 @@ "@types/markdown-it-container": "^2.0.6", "@types/nprogress": "^0.2.0", "@vite-pwa/sveltekit": "^0.2.5", - "autoprefixer": "^10.4.14", + "autoprefixer": "^10.4.16", "jsdom": "^22.1.0", + "lemmy-js-client": "^0.18.1", "markdown-it-container": "^3.0.0", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", "nprogress": "^0.2.0", - "postcss": "^8.4.24", + "postcss": "^8.4.30", "rollup-plugin-visualizer": "^5.9.2", "svelte": "^4.2.0", "svelte-check": "^3.0.1", "svelte-hero-icons": "^5.0.0", "svelte-tiny-virtual-list": "^2.0.5", - "tailwindcss": "^3.3.2", + "tailwindcss": "^3.3.3", "tslib": "^2.4.1", "typescript": "^5.0.0", "vite": "^4.3.0", @@ -42,7 +43,6 @@ "dependencies": { "@dicebear/core": "^6.0.4", "@dicebear/initials": "^6.0.4", - "lemmy-js-client": "^0.18.0-rc.2", "markdown-it": "^13.0.1", "mono-svelte": "^0.3.7" }, diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 9d51d815..ede4ee67 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -146,7 +146,24 @@ async function userFromJwt( jwt: string, instance: string ): Promise<{ user: PersonData; site: GetSiteResponse } | undefined> { - const site = await getClient(instance).getSite({ auth: jwt }) + const sitePromise = getClient(instance).getSite({ + auth: jwt, + }) + + let timer = setTimeout( + () => + toast({ + content: `It's taking a while to fetch your user. Is your instance down?`, + type: 'warning', + }), + 5000 + ) + + const site = await sitePromise.then((r) => { + clearTimeout(timer) + return r + }) + const myUser = site.my_user if (!myUser) return undefined diff --git a/src/routes/verify_email/[token]/+error.svelte b/src/routes/verify_email/[token]/+error.svelte new file mode 100644 index 00000000..9cf26a4f --- /dev/null +++ b/src/routes/verify_email/[token]/+error.svelte @@ -0,0 +1,15 @@ + + +
+
+ +
+

Error

+

Failed to verify your email.

+ {$page.error?.message} +
diff --git a/src/routes/verify_email/[token]/+page.svelte b/src/routes/verify_email/[token]/+page.svelte new file mode 100644 index 00000000..60973023 --- /dev/null +++ b/src/routes/verify_email/[token]/+page.svelte @@ -0,0 +1,24 @@ + + +
+
+ +
+

+ Success +

+

+ Your email was verified. You can safely close this window. +

+ {#if !LINKED_INSTANCE_URL} +

+ You somehow got to this menu despite not being linked here by the email. + Nice! +

+ {/if} +
diff --git a/src/routes/verify_email/[token]/+page.ts b/src/routes/verify_email/[token]/+page.ts new file mode 100644 index 00000000..2c1321db --- /dev/null +++ b/src/routes/verify_email/[token]/+page.ts @@ -0,0 +1,8 @@ +import { getClient } from '$lib/lemmy.js' +import { error } from '@sveltejs/kit' + +export async function load({ fetch, params }) { + await getClient(undefined, fetch).verifyEmail({ + token: params.token, + }) +} diff --git a/yarn.lock b/yarn.lock index bd03562e..48fec4d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1600,14 +1600,14 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -autoprefixer@^10.4.14: - version "10.4.14" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.14.tgz#e28d49902f8e759dd25b153264e862df2705f79d" - integrity sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ== - dependencies: - browserslist "^4.21.5" - caniuse-lite "^1.0.30001464" - fraction.js "^4.2.0" +autoprefixer@^10.4.16: + version "10.4.16" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.16.tgz#fad1411024d8670880bdece3970aa72e3572feb8" + integrity sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ== + dependencies: + browserslist "^4.21.10" + caniuse-lite "^1.0.30001538" + fraction.js "^4.3.6" normalize-range "^0.1.2" picocolors "^1.0.0" postcss-value-parser "^4.2.0" @@ -1680,15 +1680,15 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.21.5: - version "4.21.9" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" - integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== +browserslist@^4.21.10: + version "4.22.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.0.tgz#6adc8116589ccea8a99d0df79c5de2436199abdb" + integrity sha512-v+Jcv64L2LbfTC6OnRcaxtqJNJuQAVhZKSJfR/6hn7lhnChUXl4amwVviqN1k411BB+3rRoKMitELRn1CojeRA== dependencies: - caniuse-lite "^1.0.30001503" - electron-to-chromium "^1.4.431" - node-releases "^2.0.12" - update-browserslist-db "^1.0.11" + caniuse-lite "^1.0.30001539" + electron-to-chromium "^1.4.530" + node-releases "^2.0.13" + update-browserslist-db "^1.0.13" browserslist@^4.21.9: version "4.21.10" @@ -1745,16 +1745,16 @@ camelcase-css@^2.0.1: resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== -caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503: - version "1.0.30001515" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" - integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== - caniuse-lite@^1.0.30001517: version "1.0.30001518" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001518.tgz#b3ca93904cb4699c01218246c4d77a71dbe97150" integrity sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA== +caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001539: + version "1.0.30001539" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001539.tgz#325a387ab1ed236df2c12dc6cd43a4fff9903a44" + integrity sha512-hfS5tE8bnNiNvEOEkm8HElUHroYwlqMMENEzELymy77+tJ6m+gA2krtHl5hxJaj71OlpC2cHZbdSMX1/YEqEkA== + chai@^4.3.7: version "4.3.7" resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" @@ -2025,16 +2025,16 @@ ejs@^3.1.6: dependencies: jake "^10.8.5" -electron-to-chromium@^1.4.431: - version "1.4.461" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.461.tgz#6b14af66042732bf883ab63a4d82cac8f35eb252" - integrity sha512-1JkvV2sgEGTDXjdsaQCeSwYYuhLRphRpc+g6EHTFELJXEiznLt3/0pZ9JuAOQ5p2rI3YxKTbivtvajirIfhrEQ== - electron-to-chromium@^1.4.477: version "1.4.482" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.482.tgz#77c5ed37b93d4dda860e27538e0e2a01d6a19e02" integrity sha512-h+UqpfmEr1Qkk0zp7ej/jid7CXoq4m4QzW6wNTb0ELJ/BZCpA4wgUylBIMGCe621tnr4l5VmoHjdoSx2lbnNJA== +electron-to-chromium@^1.4.530: + version "1.4.530" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.530.tgz#c31a44346739bb34acb1a4026a07c3b9eeeb326c" + integrity sha512-rsJ9O8SCI4etS8TBsXuRfHa2eZReJhnGf5MHZd3Vo05PukWHKXhk3VQGbHHnDLa8nZz9woPCpLCMQpLGgkGNRA== + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -2241,10 +2241,10 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -fraction.js@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" - integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== +fraction.js@^4.3.6: + version "4.3.6" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.6.tgz#e9e3acec6c9a28cf7bc36cbe35eea4ceb2c5c92d" + integrity sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg== fs-extra@^9.0.1: version "9.1.0" @@ -2821,7 +2821,7 @@ kleur@^4.1.5: resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== -lemmy-js-client@^0.18.0-rc.2: +lemmy-js-client@^0.18.1: version "0.18.1" resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.18.1.tgz#28df266eded0ef4a72b05ee6eabebddadfd81a27" integrity sha512-maafUZ9ZJkXthRZmM0+limJmymF2kmN/8SiKufS3V4OVNM72s+wUFFiyhKmA370g23iZRW6SUagE7jNKnqNyYQ== @@ -3066,13 +3066,13 @@ nanoid@^3.3.6: integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== node-fetch@^2.6.12: - version "2.6.12" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" -node-releases@^2.0.12, node-releases@^2.0.13: +node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== @@ -3266,7 +3266,7 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.2.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@^8.4.23, postcss@^8.4.24, postcss@^8.4.25: +postcss@^8.4.23, postcss@^8.4.25: version "8.4.26" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.26.tgz#1bc62ab19f8e1e5463d98cf74af39702a00a9e94" integrity sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw== @@ -3275,6 +3275,15 @@ postcss@^8.4.23, postcss@^8.4.24, postcss@^8.4.25: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.30: + version "8.4.30" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.30.tgz#0e0648d551a606ef2192a26da4cabafcc09c1aa7" + integrity sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g== + dependencies: + nanoid "^3.3.6" + picocolors "^1.0.0" + source-map-js "^1.0.2" + pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -3836,7 +3845,7 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -tailwindcss@^3.3.2: +tailwindcss@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.3.tgz#90da807393a2859189e48e9e7000e6880a736daf" integrity sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w== @@ -4130,6 +4139,14 @@ update-browserslist-db@^1.0.11: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" From 505175277c4e894b00025d2b87cac63f6c403283 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 26 Sep 2023 16:27:16 -0700 Subject: [PATCH 2/5] feat: add password resets --- src/routes/login/+page.svelte | 11 ++- src/routes/login_reset/+page.svelte | 64 ++++++++++++++ .../password_change/[token]/+error.svelte | 17 ++++ .../password_change/[token]/+page.svelte | 83 +++++++++++++++++++ src/routes/password_change/[token]/+page.ts | 3 + 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 src/routes/login_reset/+page.svelte create mode 100644 src/routes/password_change/[token]/+error.svelte create mode 100644 src/routes/password_change/[token]/+page.svelte create mode 100644 src/routes/password_change/[token]/+page.ts diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 565d0a62..8b0ffce2 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -6,7 +6,12 @@ import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js' import { getClient, validateInstance } from '$lib/lemmy.js' import { Button, TextInput } from 'mono-svelte' - import { AtSymbol, Icon, Identification } from 'svelte-hero-icons' + import { + AtSymbol, + Icon, + Identification, + QuestionMarkCircle, + } from 'svelte-hero-icons' let data = { instance: DEFAULT_INSTANCE_URL, @@ -116,6 +121,10 @@ Sign Up + diff --git a/src/routes/login_reset/+page.svelte b/src/routes/login_reset/+page.svelte new file mode 100644 index 00000000..889f9f54 --- /dev/null +++ b/src/routes/login_reset/+page.svelte @@ -0,0 +1,64 @@ + + +
+

Reset Password

+

+ Enter the email of your account, and a password reset link will be sent. If + you did not have an email set up, contact your instance admins. +

+
+ {#if !LINKED_INSTANCE_URL} + + {/if} + + + +
diff --git a/src/routes/password_change/[token]/+error.svelte b/src/routes/password_change/[token]/+error.svelte new file mode 100644 index 00000000..ed12fc81 --- /dev/null +++ b/src/routes/password_change/[token]/+error.svelte @@ -0,0 +1,17 @@ + + +
+
+ +
+

Error

+

+ That password reset token doesn't exist. +

+ {$page.error?.message} +
diff --git a/src/routes/password_change/[token]/+page.svelte b/src/routes/password_change/[token]/+page.svelte new file mode 100644 index 00000000..f1d1e835 --- /dev/null +++ b/src/routes/password_change/[token]/+page.svelte @@ -0,0 +1,83 @@ + + +
+

Reset Password

+

+ You've clicked an email with the password reset link in it. Now, choose your + new password. +

+
+ {#if !LINKED_INSTANCE_URL} + + + What instance did you reset your password for? + + + {/if} + + + + +
diff --git a/src/routes/password_change/[token]/+page.ts b/src/routes/password_change/[token]/+page.ts new file mode 100644 index 00000000..8f31c281 --- /dev/null +++ b/src/routes/password_change/[token]/+page.ts @@ -0,0 +1,3 @@ +export const load = ({ params }) => ({ + token: params.token, +}) From 76f22dab5c94ce224ffd58db35947ef89f9d10ac Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 26 Sep 2023 18:19:16 -0700 Subject: [PATCH 3/5] feat: add password changing --- src/lib/auth.ts | 15 ++++- src/routes/communities/+page.svelte | 2 +- src/routes/create/post/+page.svelte | 2 +- src/routes/moderation/+page.svelte | 2 +- src/routes/profile/(local_user)/+layout.ts | 7 --- .../(local_user)/password/+page.svelte | 55 +++++++++++++++++++ .../(local_user)/settings/+page.svelte | 6 +- src/routes/profile/+layout.svelte | 9 ++- src/routes/profile/+layout.ts | 41 ++------------ src/routes/profile/user/+page.ts | 49 +++++++++++++++++ src/routes/saved/+page.svelte | 2 +- src/routes/search/+page.svelte | 2 +- 12 files changed, 138 insertions(+), 54 deletions(-) delete mode 100644 src/routes/profile/(local_user)/+layout.ts create mode 100644 src/routes/profile/(local_user)/password/+page.svelte create mode 100644 src/routes/profile/user/+page.ts diff --git a/src/lib/auth.ts b/src/lib/auth.ts index ede4ee67..34fab3c4 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -135,7 +135,7 @@ export async function setUser(jwt: string, inst: string, username: string) { return { profile: id, - profiles: [...pd.profiles, newProfile], + profiles: [newProfile, ...pd.profiles], } }) @@ -227,6 +227,19 @@ instance.subscribe(async (i) => { } catch (e) {} }) +export function updateJwt(id: number, newJwt: string) { + const pd = get(profileData) + let prof = pd.profiles.find((p) => p.id == id) + + if (!prof) return + prof = serializeUser(prof) + prof.jwt = newJwt + + profileData.update((p) => ({ ...p, profile: id })) + + profile.update(() => prof) +} + export async function setUserID(id: number) { const pd = get(profileData) if (id == -1) { diff --git a/src/routes/communities/+page.svelte b/src/routes/communities/+page.svelte index 7bdb4ede..7d7bc635 100644 --- a/src/routes/communities/+page.svelte +++ b/src/routes/communities/+page.svelte @@ -40,7 +40,7 @@ Communities -

+

Communities goto(`/post/${e.detail.post.id}`)} > -

Create Post

+

Create Post

diff --git a/src/routes/moderation/+page.svelte b/src/routes/moderation/+page.svelte index a2f6d6ad..0b2c31d7 100644 --- a/src/routes/moderation/+page.svelte +++ b/src/routes/moderation/+page.svelte @@ -19,7 +19,7 @@
-

Reports

+

Reports

Date: Tue, 26 Sep 2023 18:35:51 -0700 Subject: [PATCH 4/5] fix: make password changing actually work --- src/lib/auth.ts | 13 ------------- src/routes/admin/config/+page.svelte | 10 ++++++++++ src/routes/login/+page.svelte | 3 +-- .../profile/(local_user)/password/+page.svelte | 17 +++++++++++++---- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 34fab3c4..5e824d6e 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -227,19 +227,6 @@ instance.subscribe(async (i) => { } catch (e) {} }) -export function updateJwt(id: number, newJwt: string) { - const pd = get(profileData) - let prof = pd.profiles.find((p) => p.id == id) - - if (!prof) return - prof = serializeUser(prof) - prof.jwt = newJwt - - profileData.update((p) => ({ ...p, profile: id })) - - profile.update(() => prof) -} - export async function setUserID(id: number) { const pd = get(profileData) if (id == -1) { diff --git a/src/routes/admin/config/+page.svelte b/src/routes/admin/config/+page.svelte index 920d7e82..dc293a15 100644 --- a/src/routes/admin/config/+page.svelte +++ b/src/routes/admin/config/+page.svelte @@ -128,6 +128,16 @@ Federation enabled + + Federation debug mode + + + Captcha enabled + + {#if formData.captcha_enabled} + {console.log(formData.captcha_difficulty)} +