Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 5f45345

Browse files
author
berrysauce
committed
Added password strength indicator, changed widget style, added changelog widget
1 parent 57a66a8 commit 5f45345

26 files changed

+108
-46
lines changed

main.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,21 @@
1818
import json
1919

2020

21-
# Initialize Sentry
21+
"""
22+
-----------------------------------------------------------------------------
23+
SETUP
24+
-----------------------------------------------------------------------------
25+
"""
26+
27+
# INITIALIZE SENTRY ############################################
28+
2229
sentry_sdk.init(
2330
"https://945096747f3a40a68a51ed8d493be8d8@o309026.ingest.sentry.io/5955006",
2431
traces_sample_rate=1.0
2532
)
2633

34+
# APPLICATION SETUP ############################################
35+
2736
load_dotenv()
2837
app = FastAPI(
2938
docs_url=None,
@@ -41,6 +50,8 @@
4150
# PRODUCTION EXPIRY: 720
4251
ACCESS_TOKEN_EXPIRE_MINUTES = 720
4352

53+
# FUNCTION AND CLASS DECLARATION ###############################
54+
4455
def createtoken(data: dict, expires_delta: Optional[timedelta] = None):
4556
to_encode = data.copy()
4657
if expires_delta:
@@ -172,7 +183,13 @@ def logout(response: Response, key: str = Depends(get_current_user)):
172183
return response
173184

174185
@app.post("/login/create")
175-
def create(username: str = Form(...), password: str = Form(...)):
186+
def create(username: str = Form(...), password: str = Form(...), captcha: str = Form(None, alias="h-captcha-response")):
187+
if captcha is None:
188+
raise HTTPException(status_code=401, detail="Unauthorized. Captcha failed.")
189+
else:
190+
if verifycaptcha(captcha) is False:
191+
raise HTTPException(status_code=401, detail="Unauthorized. Captcha failed.")
192+
176193
domain = username
177194
if len(sitesdb.fetch({"domain": domain}).items) != 0:
178195
raise HTTPException(status_code=409, detail="Domain is already registered.")
@@ -278,7 +295,7 @@ def forgot3(request: Request, key: str):
278295

279296
return templates.TemplateResponse("forgot-step3.html", {
280297
"request": request,
281-
"key": verification["key"],
298+
"key": verification["key"]
282299
})
283300

284301

-80.6 KB
Binary file not shown.
-7.46 KB
Binary file not shown.
-22.9 KB
Binary file not shown.
-5.93 KB
Binary file not shown.

templates/assets/img/browserconfig.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.
-969 Bytes
Binary file not shown.
-1.62 KB
Binary file not shown.

templates/assets/img/favicon.ico

-14.7 KB
Binary file not shown.
-103 KB
Binary file not shown.

0 commit comments

Comments
 (0)