summaryrefslogtreecommitdiff
path: root/web/source/settings/components/authorization
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-03-17[feature] Application creation + management via API + settings panel (#3906)Libravatar tobi2
* [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-02-26[feature] Enforce OAuth token scopes (#3835)Libravatar tobi2
* move tokenauth to apiutil * enforce scopes * docs * update test models, remove deprecated "follow" * file header * tests * tweak scope matcher * simplify... * fix tests * log user out of settings panel in case of oauth error
2024-05-05[feature] Add HTTP header permission section to frontend (#2893)Libravatar tobi1
* [feature] Add HTTP header filter section to frontend * tweak naming a bit
2023-10-17[feature] Allow import/export/creation of domain allows via admin panel (#2264)v0.12.0-rc1Libravatar tobi2
* 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 tobi2
* 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-03-12update license headers (#1612)Libravatar f0x522
2023-01-25[chore] Settings refactor fix4 (#1383)Libravatar f0x521
* fix error handling behavior in emoji overview and FormWithData components * css: long domain cutoff * unused require * eslint vscode task
2023-01-19[chore] Add name to instance field for autosuggestion (#1359)Libravatar f0x521
2023-01-18[chore] Settings refactor fix 2 (#1357)Libravatar f0x521
* fix emoji query tagging * fix proxy url for gts instance * fix: don't flash callback error on authorize flow
2023-01-18[frogend] Settings refactor (#1318)Libravatar f0x522
* yakshave new form field structure * fully refactor user profile settings form * use rtk query api for profile settings * refactor user post settings * refactor password change form * refactor admin settings * FormWithData structure for user forms * admin actions refactor * whitespace * fix user settings data prop * remove superfluous logging * cleanup old code * refactor federation/suspend (overview, detail) * mostly abstracted (emoji) checkbox list * refactor parse-from-toot * refactor custom-emoji, progress on federation bulk * loading icon styling to prevent big spinny * refactor federation import-export interface * cleanup old files * [chore] Update/add license headers for 2023 * redux fixes * text-field exports * appease the linter * refactor authentication with RTK Query * fix login/logout state transition weirdness * fixes/cleanup * small linter-related fixes * add eslint license header check, fix existing files * remove old code, clarify comment * clarify suspend on subdomains * collapse if/else * fa-fw width info comment