Compare commits
2 Commits
v0.9
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81b16c374a | ||
|
|
a36b6e9865 |
@@ -33,7 +33,7 @@ pydantic_core==2.41.4
|
||||
Pygments==2.19.2
|
||||
PyJWT==2.10.1
|
||||
python-dotenv==1.1.1
|
||||
python-multipart==0.0.20
|
||||
python-multipart==0.0.22
|
||||
PyYAML==6.0.3
|
||||
resend==2.19.0
|
||||
rich==14.2.0
|
||||
|
||||
@@ -34,6 +34,7 @@ from slopserver.settings import settings
|
||||
from slopserver.models import Domain, Path, User
|
||||
from slopserver.models import SlopReport, SignupForm, altcha_validator
|
||||
from slopserver.db import select_slop, insert_slop, get_user, create_user, verify_user_email
|
||||
from slopserver.email import generate_verification_email, send_email
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@@ -150,9 +151,10 @@ def signup_form(form_data: Annotated[SignupForm, Form()]):
|
||||
# send verification email
|
||||
# create a jwt encoding the username and a time limit to be the verification URL
|
||||
token = generate_verification_token(form_data.email)
|
||||
return token
|
||||
|
||||
|
||||
|
||||
email_html = generate_verification_email(settings.api_base + "verify/?token=" + token)
|
||||
status = send_email(form_data.email, "Slop Farmer Email Verification", email_html)
|
||||
return status
|
||||
|
||||
@app.get("/verify")
|
||||
def verify_email(token: Annotated[str, AfterValidator(verify_verification_token)]):
|
||||
|
||||
@@ -8,5 +8,6 @@ class ServerSettings(BaseSettings):
|
||||
resend_token: str = "re_NXpjzbqR_KgAbu72PKjYHcquX24WvnN3i"
|
||||
|
||||
sender_email: str = "slopfarmer@jack-case.pro"
|
||||
api_base: str = "api.slopfarmer.jack-case.pro/"
|
||||
|
||||
settings = ServerSettings()
|
||||
|
||||
Reference in New Issue
Block a user