Skip to content

s2xon/userauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📧 Email and Password Handler 🛡️

Step 1: Clone the Repository: ssh

git clone [email protected]:s2xon/userauth.git cd email-password-handler

Step 2: 🌐 PlanetScale Database Setup

Create a PlanetScale account if you don't have one.

Set up a database named "data" on PlanetScale.

Step 3: 🛠️ Obtain PlanetScale .env

Obtain the necessary environment variables/.env from your PlanetScale account for connecting to the "data" database.

Step 4: 🔄 Update Dependencies

go mod tidy

Step 5: 🚀 Run the Server

go run server/main.go

Step 6: 📬 Making a POST Request

Navigate to the project directory in your terminal. Make a POST request to the root ("/") of the server with a JSON body containing an "Email" and "Password." You can use the following example code within a JavaScript file (e.g., main.js):

 document.querySelector("button").addEventListener("click", (e) => {
     e.preventDefault();
     fetch(url, {
         method: 'POST',
         headers: {
             "Content-Type": "application/json",
         },
         body: JSON.stringify({
             email: Email,
             password: Password,
         }),
     })
     .then((response) => console.log(response.json()));
 });

Step 7: 📖 Learning More

If you want to delve deeper into the technologies used in this project, explore the following resources:

Happy coding! 👩‍💻👨‍💻

About

Create a custom user authentication system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published