File size: 1,587 Bytes
1e778ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Biryani Hub - Login</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
    <div class="container">
        <h1>Login to Biryani Hub 🍽</h1>
        <label for="loginEmail">Your Email</label>
        <input type="text" id="loginEmail" placeholder="Your email..." readonly>

        <label for="loginMobile">Your Mobile Number</label>
        <input type="text" id="loginMobile" placeholder="Your mobile number..." readonly>

        <p class="info" id="infoMessageLogin">Listening 🗣🎙️...</p>
        <button onclick="startLogin()">Login</button>
    </div>

    <script>
        function startLogin() {
            fetch('/validate_login', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({
                    email: document.getElementById('loginEmail').value,
                    mobile: document.getElementById('loginMobile').value
                })
            })
            .then(response => response.json())
            .then(data => {
                if (data.success) {
                    alert("Login successful! Redirecting...");
                    window.location.href = "/menu";  // Redirect to the menu or home page
                } else {
                    alert("Error: " + data.error);
                }
            });
        }
    </script>
</body>
</html>