-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
executable file
·38 lines (32 loc) · 1008 Bytes
/
app.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File name : app.py
# Author : Podalirius (@podalirius_)
# Date created : 9 Mar 2022
import time
import random
from flask import Flask, request
app = Flask(__name__)
@app.route("/login", methods=["GET", "POST"])
def login():
username = request.form.get("username")
password = request.form.get("password")
if username in ["admin", "podalirius"]:
time.sleep(random.randint(190, 200) / 1000) # Simulate response time of heavy app
if password == "V3ryS3cur3":
return {
"success": True,
"message": "Redirecting to /home/ ..."
}
else:
return {
"success": False,
"message": "Invalid username or password."
}
else:
return {
"success": False,
"message": "Invalid username or password."
}
if __name__ == '__main__':
app.run(host="0.0.0.0")