File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ export function AuthProvider({ children }: { children: JSX.Element }) {
52
52
*/
53
53
useEffect ( ( ) => {
54
54
auth . resolveUser ( 2000 ) . onAuthStateChanged ( ( user : User , error ) => {
55
- console . log ( "auth state changed " , user )
56
55
if ( user ) {
57
56
setUser ( user )
58
57
setError ( null )
Original file line number Diff line number Diff line change @@ -28,11 +28,12 @@ export default function SignIn() {
28
28
if ( ! initializing ) {
29
29
if ( user ) {
30
30
const redirect = getRedirect ( )
31
- if ( redirect ) {
31
+ console . log ( "redirect: " , redirect )
32
+ if ( redirect !== null ) {
32
33
router . push ( redirect ) // go to page which redirected to login
33
34
clearRedirect ( )
34
35
} else {
35
- router . push ( "/protected" ) // go to default protected page
36
+ router . back ( ) // go to previous page
36
37
}
37
38
}
38
39
}
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Feb 16, 2023
Successfully deployed to the following URLs:
static-page-login-example – ./
static-page-login-example.vercel.app
static-page-login-example-git-main-ivandotv.vercel.app
static-page-login-example-ivandotv.vercel.app