Initial commit: abyssVpn project

- Tauri desktop app (apps/desktop)
- Python Django API service (services/api)
- Deployment scripts and docs
This commit is contained in:
arthur_chen
2026-05-15 09:06:10 +08:00
commit f69efb67ad
146 changed files with 18039 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
+16
View File
@@ -0,0 +1,16 @@
from django.http import HttpRequest
from accounts.models import User
from accounts.services.jwt_service import decode_jwt
def get_current_user(request: HttpRequest) -> User | None:
auth = request.headers.get("Authorization", "")
if not auth.startswith("Bearer "):
return None
try:
payload = decode_jwt(auth.removeprefix("Bearer ").strip())
return User.objects.get(id=payload["sub"], status=User.STATUS_ACTIVE)
except Exception:
return None