| Age | Commit message (Collapse) | Author | Files |
|
# 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>
|
|
* [feature] Application creation + management via API + settings panel
* fix docs links
* add errnorows test
* use known application as shorter
* add comment about side effects
|
|
* 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
|
|
* [feature] Add HTTP header filter section to frontend
* tweak naming a bit
|
|
* 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
|
|
* 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>
|