mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-17 22:21:35 +08:00

* [WIP] Add OAuth 2.0 authorization login * Add social user relationship table * Update social user relationship table back_populates * Add OAuth 2.0 related interface * Automatically redirect authorization addresses * Update OAuth2 authorization to GitHub * Add implementation code * fix the callback interface return * fix typo * fix the api return * fix imports * Fix logic for creating system users and social tables * Fix user information storage * Add OAuth2 source link * remove unnecessary db refresh * remove the front end docker-compose annotation
22 lines
485 B
Python
22 lines
485 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from backend.app.common.enums import UserSocialType
|
|
from backend.app.schemas.base import SchemaBase
|
|
|
|
|
|
class UserSocialSchemaBase(SchemaBase):
|
|
source: UserSocialType
|
|
open_id: str | None = None
|
|
uid: str | None = None
|
|
union_id: str | None = None
|
|
scope: str | None = None
|
|
code: str | None = None
|
|
|
|
|
|
class CreateUserSocialParam(UserSocialSchemaBase):
|
|
user_id: int
|
|
|
|
|
|
class UpdateUserSocialParam(SchemaBase):
|
|
pass
|