File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 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 }) {
5252 */
5353 useEffect ( ( ) => {
5454 auth . resolveUser ( 2000 ) . onAuthStateChanged ( ( user : User , error ) => {
55- console . log ( "auth state changed " , user )
5655 if ( user ) {
5756 setUser ( user )
5857 setError ( null )
Original file line number Diff line number Diff line change @@ -28,11 +28,12 @@ export default function SignIn() {
2828 if ( ! initializing ) {
2929 if ( user ) {
3030 const redirect = getRedirect ( )
31- if ( redirect ) {
31+ console . log ( "redirect: " , redirect )
32+ if ( redirect !== null ) {
3233 router . push ( redirect ) // go to page which redirected to login
3334 clearRedirect ( )
3435 } else {
35- router . push ( "/protected" ) // go to default protected page
36+ router . back ( ) // go to previous page
3637 }
3738 }
3839 }
You can’t perform that action at this time.
0 commit comments