This commit is contained in:
rngsurrounded
2025-03-01 18:20:22 +09:00
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -22,4 +22,4 @@ class LoginSchema(ModelSchema):
class UserSchema(ModelSchema):
class Meta:
model = User
fields = ["email", "username"]
fields = ["id", "email", "username"]
+10
View File
@@ -54,6 +54,16 @@ def sign_in(request, data: LoginSchema):
return status.OK, TokenSchema(token=token)
@router.get(
"/me",
response={
status.OK: UserSchema,
status.UNAUTHORIZED: ForbiddenError,
},
)
def get_me(request):
return 200, request.auth
@router.get(
path="/user/{user_id}",
response={