summaryrefslogtreecommitdiff
path: root/web/source/settings/lib
AgeCommit message (Collapse)AuthorFiles
2026-01-22[bugfix] Check that token is defined before logging the user out (#4632)v0.20.3Libravatar prettysunflower1
# Description This pull request should fix #3761? So, currently, the [logout mutation](https://codeberg.org/superseriousbusiness/gotosocial/src/commit/b310e99b436357bb34b98f1b9233f3c9c69aaab0/web/source/settings/lib/query/login/index.ts#L189) is expecting the token to be defined, and throws if it isn't. However, the auth component logout the user if an error is found while verifying credentials, and there are cases where the token can at this point be undefined. (this happens to me a lot when I want to get to GTS's settings, I start the login flow, approve the login on my OIDC, get distracted, and forget to approve the oauth app) In this case, the user is stuck on a white page until they finish the previous login attempt (which can be difficult if the process was abandoned), or delete the site's local storage. This pull request checks for the presence of the token before logging out the user (avoiding the logout mutation to throw and result in a white page), and the absence of the token to restart the authentication process. The error that was the reason that logoutQuery was called is now displayed to the user, and the user has the ability to restart the login process. ## Checklist Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]` If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want). - [X] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [X] I/we have not used so-called 'AI' to create the proposed changes. - [ ] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [X] I/we have performed a self-review of added code. - [X] I/we have written code that is legible and maintainable by others. - [X] I/we have commented the added code, particularly in hard-to-understand areas. - [ ] I/we have made any necessary changes to documentation. - I don't think this is applicable? - [ ] I/we have added tests that cover new code. - Only TypeScript was edited, and I don't think there are tests currently implemented for that part? - [X] I/we have run tests and they pass locally with the changes. - [X] I/we have run `go fmt ./...` and `golangci-lint run`. - golangci-lint indicated 3 issues that were not introduced by this pull request Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4632 Co-authored-by: prettysunflower <me@prettysunflower.moe> Co-committed-by: prettysunflower <me@prettysunflower.moe>
2025-10-17[feature] granular admin scopes for custom emojis (#4489)Libravatar Vyr Cossont1
This PR adds admin equivalents of the `read:custom_emojis` OAuth scope: `admin:read:custom_emojis` and `admin:write:custom_emojis`. This is so tools which only touch emojis can run without other admin permissions. (`slurp emojis import` is one such tool.) I've also sorted the admin section of the scopes lists alphabetically like the non-admin section, and updated the Swagger test script to print the same command path that it actually runs. ## API compatibility Neither [Mastodon](https://docs.joinmastodon.org/api/oauth-scopes/) nor Akkoma nor Iceshrimp.NET has an equivalent scope, so there are no alternate scope names to worry about. Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4489 Co-authored-by: Vyr Cossont <vyr@noreply.codeberg.org> Co-committed-by: Vyr Cossont <vyr@noreply.codeberg.org>
2025-05-26[feature] Add "Instance Info" settings panel section, with domain blocks + ↵Libravatar tobi5
allows (#4193) This pull request adds a new read-only, user-level "instance info" section to the settings panel, which presents api/v2/instance info in a nice readable format, and also gives the user authenticated access to the blocklist and allowlist of the domain. Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/3711 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4193 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
2025-04-27[chore] Rewrite all remaining Github linksLibravatar Daenney1
2025-04-26[feature] Move to code.superseriousbusiness.orgLibravatar Daenney1
2025-04-19[bugfix] Fix '+'-separated scopes not being recognized (#4028)Libravatar tobi2
* [bugfix] Fix '+'-separated scopes not being recognized * comment
2025-04-19[chore] Little settings panel report view tweak (#4025)v0.19.0-rc2Libravatar tobi1
2025-04-10[feature] Implement /oauth/revoke for token revocation (#3983)Libravatar tobi1
2025-04-09[bugfix] Fix a couple accessibility issues with `:focus` elements (#3979)Libravatar tobi1
* [bugfix/frontend] Fix accessibility/focus issues in settings + web ui * fix little error * tweaks
2025-04-07[feature] add TOTP two-factor authentication (2FA) (#3960)Libravatar tobi4
* [feature] add TOTP two-factor authentication (2FA) * use byteutil.S2B to avoid allocations when comparing + generating password hashes * don't bother with string conversion for consts * use io.ReadFull * use MustGenerateSecret for backup codes * rename util functions
2025-04-05[feature] Allow deleting avatar + header via settings panel (#3970)Libravatar tobi1
2025-04-04[feature] Allow editing domain blocks/allows, fix comment import (#3967)Libravatar tobi3
* start implementing editing of existing domain permissions * [feature] Allow editing domain blocks/allows, fix comment import * [bugfix] Use "comment" via /api/v1/instance * fix the stuff
2025-03-26[feature] Allow user to choose "gallery" style layout for web view of ↵Libravatar tobi1
profile (#3917) * [feature] Allow user to choose "gallery" style web layout * find a bug and squish it up and all day long you'll have good luck * just a sec * [performance] reindex public timeline + tinker with query a bit * fiddling * should be good now * last bit of finagling, i'm done now i prommy * panic normally
2025-03-17[feature] Application creation + management via API + settings panel (#3906)Libravatar tobi10
* [feature] Application creation + management via API + settings panel * fix docs links * add errnorows test * use known application as shorter * add comment about side effects
2025-03-04[feature] Add token review / delete to backend + settings panel (#3845)Libravatar tobi3
2025-02-09[bugfix] Fix missing `hasChanged` func (#3764)Libravatar tobi1
2025-01-08[feature] Fetch + create domain permissions from subscriptions nightly (#3635)Libravatar tobi1
* peepeepoopoo * test domain perm subs * swagger * envparsing * dries your wets * start on docs * finish up docs * copy paste errors * rename actions package * rename force -> skipCache * move obfuscate parse nearer to where err is checked * make higherPrios a simple slice * don't use receiver for permsFrom funcs * add more context to error logs * defer finished log * use switch for permType instead of if/else * thanks linter, love you <3 * validate csv headers before full read * use bufio scanner
2025-01-05[feature] Create/update/remove domain permission subscriptions (#3623)Libravatar tobi9
* [feature] Create/update/remove domain permission subscriptions * lint * envparsing * remove errant fmt.Println * create drafts, subs, exclude, from snapshot models * name etag column correctly * remove count column * lint
2024-12-02[feature] Add global instance CSS customization setting (#3352)Libravatar Victor Dyotte1
Allow instance admins to add custom CSS that will affect every page of their instance. This is done with a new CustomCSS instance setting that works pretty much exactly like the Users CustomCSS property. This custom CSS is then requested for every page load. User styles/themes take precedence over this CSS. Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-11-21[feature] Add domain permission drafts and excludes (#3547)Libravatar tobi9
* [feature] Add domain permission drafts and excludes * fix typescript complaining * lint * make filenames more consistent * test own domain excluded
2024-10-21[feature] Add image descriptions for default avatar + header; don't allow ↵v0.17.1Libravatar tobi2
editing default desc (#3473)
2024-08-24[feature] Interaction requests client api + settings panel (#3215)Libravatar tobi5
* [feature] Interaction requests client api + settings panel * test accept / reject * fmt * don't pin rejected interaction * use single db model for interaction accept, reject, and request * swaggor * env sharting * append errors * remove ErrNoEntries checks * change intReqID to reqID * rename "pend" to "request" * markIntsPending -> mark interactionsPending * use log instead of returning error when rejecting interaction * empty migration * jolly renaming * make interactionURI unique again * swag grr * remove unnecessary locks * invalidate as last step
2024-08-02[feature] Allow import of following and blocks via CSV (#3150)Libravatar tobi1
* [feature] Import follows + blocks via settings panel * test import follows
2024-07-31[feature] Allow users to export data via the settings panel (#3140)Libravatar tobi3
* [feature] Allow users to export data via the settings panel * rename/move some stuff
2024-07-17[feature] Allow users to set default interaction policies per status ↵Libravatar tobi4
visibility (#3108) * [feature] Allow users to set default interaction policies * use vars for default policies * avoid some code repetition * unfuck form binding * avoid bonkers loop * beep boop * put policyValsToAPIPolicyVals in separate function * don't bother with slices.Grow * oops
2024-06-18[feature/frontend] Reports frontend v2 (#3022)Libravatar tobi5
* use apiutil + paging in admin processor+handlers * we're making it happen * fix little whoopsie * styling for report list * don't youuuu forget about meee don't don't don't don't * last bits * sanitize content before showing in report statuses * update report docs
2024-06-07[chore] Warn about email/password change when using OIDC (#2975)Libravatar tobi1
* [chore] Warn about email/password change when using OIDC * go fmt
2024-06-06[feature] Self-serve email change for users (#2957)Libravatar tobi2
* [feature] Email change * frontend stuff for changing email * docs * tests etc * differentiate more clearly between local user+account and account * populate user
2024-06-03[feature/frontend] Add debug sections to settings panel (#2950)Libravatar tobi4
* [feature/frontend] Add debug sections to settings panel * max-width * swagger
2024-05-27[feature/frontend] Let admins send test email to validate SMTP config (#2934)Libravatar tobi2
* [feature/frontend] Let admins send test email to validate SMTP config * wee
2024-05-07[bugfix] Reset emoji fields on upload error (#2905)Libravatar tobi1
2024-05-05[feature] Add HTTP header permission section to frontend (#2893)Libravatar tobi6
* [feature] Add HTTP header filter section to frontend * tweak naming a bit
2024-05-02[frontend] Do optimistic update when approving/rejecting/suspending account ↵Libravatar tobi2
(#2892)
2024-05-01[feature] Page through accounts as moderator (#2881)Libravatar tobi3
* [feature] Page through accounts as moderator * aaaaa * use COLLATE "C" for Postgres to ensure same ordering as SQLite * fix typo, test paging up * don't show moderation / info for our instance acct
2024-04-25[chore] Settings refactor 2: the re-refactoring-ing (#2866)Libravatar tobi1
* [chore] Bit more refactoring of settings panel * fix up some remaining things * groovy baby yeah! * remove unused Suspense
2024-04-24[chore] Refactor settings panel routing (and other fixes) (#2864)Libravatar tobi8
2024-04-13[feature] Admin accounts endpoints; approve/reject sign-ups (#2826)Libravatar tobi4
* update settings panels, add pending overview + approve/deny functions * add admin accounts get, approve, reject * send approved/rejected emails * use signup URL * docs! * email * swagger * web linting * fix email tests * wee lil fixerinos * use new paging logic for GetAccounts() series of admin endpoints, small changes to query building * shuffle useAccountIDIn check *before* adding to query * fix parse from toot react error * use `netip.Addr` * put valid slices in globals * optimistic updates for account state --------- Co-authored-by: kim <grufwub@gmail.com>
2024-03-25[feature] User-selectable preset CSS themes for accounts (#2777)Libravatar tobi2
* [feature] User-selectable preset themes * docs, more theme stuff * lint, tests * fix css name * correct some little issues * add another theme * fix poll background * okay last theme i swear * make retrieval of apimodel themes more conventional * preallocate stylesheet slices
2024-01-16[feature] Move + alias account via settings panel (#2519)Libravatar tobi7
* [feature] Move + alias account via settings panel * lint * type a bit more diligently
2024-01-05[feature] Parse instance descriptors as markdown, show T&C on /about (#2481)Libravatar tobi1
* [feature] Parse instance descriptors as markdown, show T&C on /about * lint * remove unnecessary nullzero tags
2023-10-24[bugfix/frontend] Export/import CSV correctly (#2294)Libravatar tobi3
* [bugfix/frontend] Export/import CSV correctly * export mastodon style
2023-10-24[bugfix/frontend] Add `nosubmit` option to form fields + use it when ↵Libravatar tobi5
instance custom CSS disabled (#2290)
2023-10-21[bugfix/frontend] fix typo and other oddness in patchRemoteEmojis (#2281)v0.12.0Libravatar tobi3
* fix emoji test model * found the bug! * remove unused 'current' import * comment useChecklistReducer * wah * lint * fix cleaner tests
2023-10-17[bugfix/frontend] Fix 'steal this look' emoji promise mapping (#2270)Libravatar tobi1
* [bugfix/frontend] Fix 'steal this look' emoji promise mapping * indent a bit nicer
2023-10-17[feature] Allow import/export/creation of domain allows via admin panel (#2264)v0.12.0-rc1Libravatar tobi37
* it's happening! * aaa * fix silly whoopsie * it's working pa! it's working ma! * model report parameters * shuffle some more stuff around * getting there * oo hoo * finish tidying up for now * aaa * fix use form submit errors * peepee poo poo * aaaaa * ffff * they see me typin', they hatin' * boop * aaa * oooo * typing typing tappa tappa * almost done typing * weee * alright * push it push it real good doo doo doo doo doo doo * thingy no worky * almost done * mutation modifers not quite right * hmm * it works * view blocks + allows nicely * it works! * typia install * the old linterino * linter plz
2023-10-05[chore] Convert some settings / admin panel JS to TypeScript (#2247)Libravatar tobi27
* initial conversion of STUFF to typescript * more stuff * update babel deps, include commonjs transform * update bundler & eslint configuration * eslint --fix * upgrade deps * update docs, build stuff, peripheral stuff --------- Co-authored-by: f0x <f0x@cthu.lu>
2023-09-12[feature] Allow admins to expire remote public keys; refetch expired keys on ↵Libravatar tobi1
demand (#2183)
2023-08-19[feature] Instance rules (#2125)Libravatar f0x523
* init instance rules database model, admin api * expose instance rules in public instance api * public /api/v1/instance/rules route * GET ruleById * createRule route * createRule auth check * updateRule * deleteRule * list rules on about page * ruleGet auth * add about page ids for anchors * process and store adding violated rules to reports * admin api models for instance rules * instance rule edit frontend * change rule inputs to textareas * database fixes after rebase (#2124) * remove unused imports * fix db migration column name * fix tests * fix more tests * fix postgres error with wrongly used Ident * add some tests, fiddle with rule model a bit, fix postgres migration * swagger docs --------- Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-06-13[Frontend] Settings for profile fields (#1885)Libravatar f0x526
* get max emoji size from instance settings * expose (hardcoded) max amount of profile fields in instance api * basic profile field setting * fix profile field hook structure for updates * *twirls mustache* fix ze tests --------- Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-05-13[frontend] Basic user moderation actions (#1728)Libravatar f0x523
* remove info banner * update swagger definition for AccountAction * basic user view, suspend action * clean up suspended user display * basic user searching * rename User -> Account for clarity * refactor error boundary component to give better info * appease the linter