removing flask_login, fixed many appwriter issues with custom class
This commit is contained in:
27
app/utils/session_user.py
Normal file
27
app/utils/session_user.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@dataclass
|
||||
class SessionUser:
|
||||
id: str = ""
|
||||
registered_on: str = ""
|
||||
name: str = ""
|
||||
email: str = ""
|
||||
email_verified: bool = False
|
||||
phone: str = ""
|
||||
phone_verified: bool = False
|
||||
mfa: bool = False
|
||||
|
||||
|
||||
@property
|
||||
def is_authenticated(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def email_verification(self) -> bool:
|
||||
return self.email_verified
|
||||
|
||||
@property
|
||||
def phone_verification(self) -> bool:
|
||||
return self.phone_verification
|
||||
Reference in New Issue
Block a user