I am trying to develop a password reset webpage to use in my email/password authentication for MongoDB Stitch, this is my code:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<!-- Stitch JavaScript SDK -->
<!-- Base Stitch Browser SDK -->
<script src="https://s3.amazonaws.com/stitch-sdks/js/bundles/4.0.0/stitch.js"></script>
<script>// Parse the URL query parameters
const url = window.location.search;
const params = new URLSearchParams(url);
const token = params.get('token');
const tokenId = params.get('tokenId');
const newPassword = "test";
// Confirm the user's email/password account
const emailPassClient = Stitch.defaultAppClient.auth
.getProviderClient(UserPasswordAuthProviderClient.factory);
emailPassClient.resetPassword(token, tokenId, newPassword).then(() => {
console.log("Successfully reset password!");
}).catch(err => {
console.log("Error resetting password:", err);
});
</script>
</body>
</html>
I am getting an error like the following:
Uncaught ReferenceError: Stitch is not defined
Perhaps I am importing the stitch bundles incorrectly?