File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 38
38
" @typescript-eslint/explicit-function-return-type " : " off"
39
39
" @typescript-eslint/explicit-module-boundary-types " : " error"
40
40
" @typescript-eslint/method-signature-style " : ["error", "property"]
41
+ " @typescript-eslint/no-floating-promises " : error
41
42
" @typescript-eslint/no-invalid-void-type " : error
42
43
# We're disabling the `no-namespace` rule to use a pattern of defining an interface,
43
44
# and then defining functions that operate on that data via namespace. This is helpful for
Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ export const SignInForm: React.FC<SignInProps> = ({
87
87
try {
88
88
await loginHandler ( email , password )
89
89
// Tell SWR to invalidate the cache for the user endpoint
90
- mutate ( "/api/v2/user" )
91
- router . push ( "/" )
90
+ await mutate ( "/api/v2/user" )
91
+ await router . push ( "/" )
92
92
} catch ( err ) {
93
93
helpers . setFieldError ( "password" , "The username or password is incorrect." )
94
94
}
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ export const useUser = (redirectOnError = false): UserContext => {
23
23
const requestError = ctx . error
24
24
useEffect ( ( ) => {
25
25
if ( redirectOnError && requestError ) {
26
- router . push ( {
26
+ // 'void' means we are ignoring handling the promise returned
27
+ // from router.push (and lets the linter know we're OK with that!)
28
+ void router . push ( {
27
29
pathname : "/login" ,
28
30
query : {
29
31
redirect : router . asPath ,
You can’t perform that action at this time.
0 commit comments