My login lightbox is not redirecting to require page properly

so, i am trying to make my login lightbox to direct users to an activity page after successful login but it is not responding

this is the code i used:

import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;

$w.onReady( function (){
$w(‘#loginNow’).onClick( function (){
let email = $w(“#loginEmail”);
let password = $w(“#loginPassword”);

    wixUsers.login(email, password) 
    .then( () => { 
        wixLocation.to('/activity') 
        console.log("User is logged in"); 
        } ) 
    . **catch** ( (err) => { 
        console.log(err); 
        } ) 
    } ) 
} ); 

Any help please?

You need to add wixWindow