Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rules:
"@typescript-eslint/explicit-function-return-type": "off"
"@typescript-eslint/explicit-module-boundary-types": "error"
"@typescript-eslint/method-signature-style": ["error", "property"]
"@typescript-eslint/no-floating-promises": error
"@typescript-eslint/no-invalid-void-type": error
# We're disabling the `no-namespace` rule to use a pattern of defining an interface,
# and then defining functions that operate on that data via namespace. This is helpful for
Expand Down
4 changes: 2 additions & 2 deletions site/components/SignIn/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export const SignInForm: React.FC<SignInProps> = ({
try {
await loginHandler(email, password)
// Tell SWR to invalidate the cache for the user endpoint
mutate("/api/v2/user")
router.push("/")
await mutate("/api/v2/user")
await router.push("/")
} catch (err) {
helpers.setFieldError("password", "The username or password is incorrect.")
}
Expand Down
4 changes: 3 additions & 1 deletion site/contexts/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export const useUser = (redirectOnError = false): UserContext => {
const requestError = ctx.error
useEffect(() => {
if (redirectOnError && requestError) {
router.push({
// 'void' means we are ignoring handling the promise returned
// from router.push (and lets the linter know we're OK with that!)
void router.push({
pathname: "/login",
query: {
redirect: router.asPath,
Expand Down