Added logic to register by discord #70
This commit is contained in:
@@ -27,6 +27,7 @@ class ApiMigration(MigrationABC):
|
||||
`RefreshToken` VARCHAR(255),
|
||||
`ConfirmationId` VARCHAR(255) DEFAULT NULL,
|
||||
`ForgotPasswordId` VARCHAR(255) DEFAULT NULL,
|
||||
`OAuthId` VARCHAR(255) DEFAULT NULL,
|
||||
`RefreshTokenExpiryTime` DATETIME(6) NOT NULL,
|
||||
`AuthRole` INT NOT NULL DEFAULT '0',
|
||||
`UserId` BIGINT DEFAULT NULL,
|
||||
|
@@ -19,6 +19,7 @@ class AuthUser(TableABC):
|
||||
refresh_token: Optional[str],
|
||||
confirmation_id: Optional[str],
|
||||
forgot_password_id: Optional[str],
|
||||
oauth_id: Optional[str],
|
||||
refresh_token_expire_time: datetime,
|
||||
auth_role: AuthRoleEnum,
|
||||
user_id: Optional[int],
|
||||
@@ -34,6 +35,7 @@ class AuthUser(TableABC):
|
||||
self._password_salt = uuid.uuid4() if password_salt is None else password_salt
|
||||
self._refresh_token = refresh_token
|
||||
self._confirmation_id = confirmation_id
|
||||
self._oauth_id = oauth_id
|
||||
self._forgot_password_id = forgot_password_id
|
||||
self._refresh_token_expire_time = refresh_token_expire_time
|
||||
|
||||
@@ -95,23 +97,31 @@ class AuthUser(TableABC):
|
||||
@refresh_token.setter
|
||||
def refresh_token(self, value: Optional[str]):
|
||||
self._refresh_token = value
|
||||
|
||||
|
||||
@property
|
||||
def confirmation_id(self) -> Optional[str]:
|
||||
return self._confirmation_id
|
||||
|
||||
|
||||
@confirmation_id.setter
|
||||
def confirmation_id(self, value: Optional[str]):
|
||||
self._confirmation_id = value
|
||||
|
||||
|
||||
@property
|
||||
def forgot_password_id(self) -> Optional[str]:
|
||||
return self._forgot_password_id
|
||||
|
||||
|
||||
@forgot_password_id.setter
|
||||
def forgot_password_id(self, value: Optional[str]):
|
||||
self._forgot_password_id = value
|
||||
|
||||
@property
|
||||
def oauth_id(self) -> Optional[str]:
|
||||
return self._oauth_id
|
||||
|
||||
@oauth_id.setter
|
||||
def oauth_id(self, value: Optional[str]):
|
||||
self._oauth_id = value
|
||||
|
||||
@property
|
||||
def refresh_token_expire_time(self) -> datetime:
|
||||
return self._refresh_token_expire_time
|
||||
@@ -183,6 +193,7 @@ class AuthUser(TableABC):
|
||||
`RefreshToken`,
|
||||
`ConfirmationId`,
|
||||
`ForgotPasswordId`,
|
||||
`OAuthId`,
|
||||
`RefreshTokenExpiryTime`,
|
||||
`AuthRole`,
|
||||
`UserId`,
|
||||
@@ -198,6 +209,7 @@ class AuthUser(TableABC):
|
||||
'{"NULL" if self._refresh_token is None else self._refresh_token}',
|
||||
'{"NULL" if self._confirmation_id is None else self._confirmation_id}',
|
||||
'{"NULL" if self._forgot_password_id is None else self._forgot_password_id}',
|
||||
'{"NULL" if self._oauth_id is None else self._oauth_id}',
|
||||
'{self._refresh_token_expire_time}',
|
||||
{self._auth_role_id.value},
|
||||
{"NULL" if self._user_id is None else self._user_id},
|
||||
@@ -218,6 +230,7 @@ class AuthUser(TableABC):
|
||||
`RefreshToken` = '{self._refresh_token}',
|
||||
`ConfirmationId` = '{"NULL" if self._confirmation_id is None else self._confirmation_id}',
|
||||
`ForgotPasswordId` = '{"NULL" if self._forgot_password_id is None else self._forgot_password_id}',
|
||||
`OAuthId` = '{"NULL" if self._oauth_id is None else self._oauth_id}',
|
||||
`RefreshTokenExpiryTime` = '{self._refresh_token_expire_time}',
|
||||
`AuthRole` = {self._auth_role_id.value},
|
||||
`UserId` = {"NULL" if self._user_id is None else self._user_id},
|
||||
|
@@ -37,8 +37,9 @@ class AuthUserRepositoryService(AuthUserRepositoryABC):
|
||||
self._get_value_from_result(result[7]),
|
||||
self._get_value_from_result(result[8]),
|
||||
self._get_value_from_result(result[9]),
|
||||
AuthRoleEnum(self._get_value_from_result(result[10])),
|
||||
self._get_value_from_result(result[11]),
|
||||
self._get_value_from_result(result[10]),
|
||||
AuthRoleEnum(self._get_value_from_result(result[11])),
|
||||
self._get_value_from_result(result[12]),
|
||||
id=self._get_value_from_result(result[0])
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user