Spaces:
Running
Running
programa girince boş geliyor admin admin123 ile girince
Browse files- app.py +2 -3
- index.html +14 -4
app.py
CHANGED
|
@@ -33,9 +33,8 @@ def login():
|
|
| 33 |
session['user_role'] = user['role']
|
| 34 |
return redirect(url_for('dashboard'))
|
| 35 |
else:
|
| 36 |
-
flash('Invalid email or password', 'error')
|
| 37 |
-
|
| 38 |
-
return render_template('index.html')
|
| 39 |
|
| 40 |
@app.route('/dashboard')
|
| 41 |
def dashboard():
|
|
|
|
| 33 |
session['user_role'] = user['role']
|
| 34 |
return redirect(url_for('dashboard'))
|
| 35 |
else:
|
| 36 |
+
flash('Invalid email or password. Please try admin@reportninja.com / admin123', 'error')
|
| 37 |
+
return render_template('index.html')
|
|
|
|
| 38 |
|
| 39 |
@app.route('/dashboard')
|
| 40 |
def dashboard():
|
index.html
CHANGED
|
@@ -37,15 +37,15 @@
|
|
| 37 |
</div>
|
| 38 |
<p class="text-indigo-100 text-center mt-1">Your data insights dashboard</p>
|
| 39 |
</div>
|
| 40 |
-
<form class="p-8 space-y-6" action="
|
| 41 |
-
<div>
|
| 42 |
<label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
| 43 |
<div class="relative">
|
| 44 |
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 45 |
<i data-feather="mail" class="text-gray-400"></i>
|
| 46 |
</div>
|
| 47 |
<input id="email" name="email" type="email" required class="pl-10 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border" placeholder="you@example.com" value="admin@reportninja.com">
|
| 48 |
-
</div>
|
| 49 |
</div>
|
| 50 |
|
| 51 |
<div>
|
|
@@ -76,7 +76,17 @@
|
|
| 76 |
</div>
|
| 77 |
</form>
|
| 78 |
|
| 79 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
<p class="text-sm text-gray-600">
|
| 81 |
Not a member yet? <a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">Request access</a>
|
| 82 |
</p>
|
|
|
|
| 37 |
</div>
|
| 38 |
<p class="text-indigo-100 text-center mt-1">Your data insights dashboard</p>
|
| 39 |
</div>
|
| 40 |
+
<form class="p-8 space-y-6" action="{{ url_for('login') }}" method="POST">
|
| 41 |
+
<div>
|
| 42 |
<label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
| 43 |
<div class="relative">
|
| 44 |
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 45 |
<i data-feather="mail" class="text-gray-400"></i>
|
| 46 |
</div>
|
| 47 |
<input id="email" name="email" type="email" required class="pl-10 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 border" placeholder="you@example.com" value="admin@reportninja.com">
|
| 48 |
+
</div>
|
| 49 |
</div>
|
| 50 |
|
| 51 |
<div>
|
|
|
|
| 76 |
</div>
|
| 77 |
</form>
|
| 78 |
|
| 79 |
+
<!-- Flash messages -->
|
| 80 |
+
{% with messages = get_flashed_messages(with_categories=true) %}
|
| 81 |
+
{% if messages %}
|
| 82 |
+
{% for category, message in messages %}
|
| 83 |
+
<div class="mt-4 p-4 rounded-md bg-red-50 border border-red-200 text-red-600 text-center">
|
| 84 |
+
{{ message }}
|
| 85 |
+
</div>
|
| 86 |
+
{% endfor %}
|
| 87 |
+
{% endif %}
|
| 88 |
+
{% endwith %}
|
| 89 |
+
<div class="px-8 pb-6 text-center">
|
| 90 |
<p class="text-sm text-gray-600">
|
| 91 |
Not a member yet? <a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">Request access</a>
|
| 92 |
</p>
|