From d6e37b6779f8d301fb53b74861aab8b1cc47ad2d Mon Sep 17 00:00:00 2001
From: danielmyren <daniel.j.myren@gmail.com>
Date: Wed, 1 May 2024 23:17:15 +0200
Subject: [PATCH] notes

---
 backend/README.md | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/backend/README.md b/backend/README.md
index 0f28e76..347de76 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -23,4 +23,35 @@ https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-20-query
     {{ register_form.password_confirm( placeholder = "Confirm Password") }}
     {{ register_form.submit() }}
 </form>
+```
+
+```js
+   const handleRegister = async (e) => {
+      e.preventDefault();
+      
+       try {
+        const response = await axios.post('http://127.0.0.1:5000/', {
+          username,
+          email,
+          password
+        }, {
+          headers: {
+            'Content-Type': 'application/json',
+            'Accept': 'application/json'
+          }
+        });
+
+        console.log('Login successful!', response.data);
+        // Redirect user to another page upon successful login
+        //history.push('/dashboard'); // Example: redirect to '/dashboard' route
+
+      } catch (error) {
+        console.error('Login failed!', error);
+        // Handle login error, display message to the user, etc.
+      }
+      
+        console.log("Register attempt with username: " + username+ " and password:" +password);
+        // Redirect user to another page upon successful login
+  
+    };
 ```
\ No newline at end of file
-- 
GitLab