(log in) To direct users to their dynamic page

I created a registration form and it works well when users register they go to their page (dynamic “id”) but now I am trying to get users to be able to log in to their site (dynamic) with (* log in ) does anyone have any idea how I can do this?

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';

$w.onReady(function () {

export function loginButton_click(event) {
 let email = $w("#email").value;
 let password = $w("#password").value;

 wixUsers.login(email, password)
   .then( () => {
     console.log("User is logged in");
     wixLocation.to("/?");  //Change the URL ending to whatever page you want to send the user to after they log in.
   } )
    .catch( (err) => {
     console.log(err);
     $w("#errorMessage").show();  // You can delete this line if you are not going to add an error message.  Use a regular text element set to 'collapse on load' from the Properties Panel.
    }
);
});
});

this is a cod works well but i do not know how to do it for dynamic pages.

Even this I am trying every kind of way but I do not know how it can guide me on the right path .

https://www.wix.com/velo/forum/community-discussion/solved-displaying-item-owner-name-on-a-dynamic-item-page

/////////////
https://www.wix.com/velo/forum/community-discussion/direct-repeater-item-to-dynamic-page

?:neutral_face: