feat: normalize email handling in signup, login, and verification processes; refactor event handling in task and reward components
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 50s
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 50s
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
import jwt
|
||||
import re
|
||||
from flask import request, current_app, jsonify
|
||||
|
||||
from events.sse import send_event_to_user
|
||||
|
||||
|
||||
def normalize_email(email: str) -> str:
|
||||
"""Normalize email for uniqueness checks (Gmail: remove dots and +aliases)."""
|
||||
email = email.strip().lower()
|
||||
if '@' not in email:
|
||||
return email
|
||||
local, domain = email.split('@', 1)
|
||||
if domain in ('gmail.com', 'googlemail.com'):
|
||||
local = local.split('+', 1)[0].replace('.', '')
|
||||
return f"{local}@{domain}"
|
||||
|
||||
def sanitize_email(email):
|
||||
return email.replace('@', '_at_').replace('.', '_dot_')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user