File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export const SignInForm: React.FC<SignInProps> = ({
88
88
await loginHandler ( email , password )
89
89
// Tell SWR to invalidate the cache for the user endpoint
90
90
await mutate ( "/api/v2/user" )
91
- router . push ( "/" )
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