pvanand commited on
Commit
7244cd2
·
verified ·
1 Parent(s): 36f58d9

Create login.html

Browse files
Files changed (1) hide show
  1. static/login.html +84 -0
static/login.html ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Login</title>
7
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
8
+ <script src="/js/auth.js"></script>
9
+ <style>
10
+ body {
11
+ font-family: Arial, sans-serif;
12
+ background: linear-gradient(to right, #4a90e2, #7e57c2);
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ height: 100vh;
17
+ margin: 0;
18
+ }
19
+ .container {
20
+ background-color: white;
21
+ padding: 2rem;
22
+ border-radius: 8px;
23
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
24
+ text-align: center;
25
+ width: 300px;
26
+ }
27
+ h1 {
28
+ color: #333;
29
+ margin-bottom: 1rem;
30
+ }
31
+ p {
32
+ color: #666;
33
+ margin-bottom: 1rem;
34
+ }
35
+ .spinner {
36
+ border: 4px solid #f3f3f3;
37
+ border-top: 4px solid #3498db;
38
+ border-radius: 50%;
39
+ width: 40px;
40
+ height: 40px;
41
+ animation: spin 1s linear infinite;
42
+ margin: 0 auto 1rem;
43
+ }
44
+ @keyframes spin {
45
+ 0% { transform: rotate(0deg); }
46
+ 100% { transform: rotate(360deg); }
47
+ }
48
+ </style>
49
+ </head>
50
+ <body>
51
+ <div class="container">
52
+ <h1>Welcome</h1>
53
+ <div class="spinner"></div>
54
+ <p>Logging in with Google...</p>
55
+ <p style="font-size: 0.9em; color: #888;">Please wait while we redirect you.</p>
56
+ </div>
57
+
58
+ <script>
59
+ // Check if already logged in
60
+ (async function() {
61
+ const session = await checkAuth();
62
+ if (session) {
63
+ window.location.href = '/research-pro';
64
+ } else {
65
+ initiateOAuth2Login();
66
+ }
67
+ })();
68
+
69
+ function initiateOAuth2Login() {
70
+ const success = `${window.location.origin}/research-pro`;
71
+ const failure = `${window.location.origin}/login`;
72
+
73
+ account.createOAuth2Session(
74
+ 'google',
75
+ success,
76
+ failure,
77
+ ['https://www.googleapis.com/auth/userinfo.email',
78
+ 'https://www.googleapis.com/auth/userinfo.profile',
79
+ 'openid']
80
+ );
81
+ }
82
+ </script>
83
+ </body>
84
+ </html>