mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-18 10:26:07 +00:00
fix: /user/check-token api not work
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import quart
|
import quart
|
||||||
import sqlalchemy
|
import jwt
|
||||||
import argon2
|
import argon2
|
||||||
|
|
||||||
from .. import group
|
from .. import group
|
||||||
@@ -42,6 +42,10 @@ class UserRouterGroup(group.RouterGroup):
|
|||||||
'token': token
|
'token': token
|
||||||
})
|
})
|
||||||
|
|
||||||
@self.route('/check-token', methods=['GET'])
|
@self.route('/check-token', methods=['GET'], auth_type=group.AuthType.USER_TOKEN)
|
||||||
async def _() -> str:
|
async def _(user_email: str) -> str:
|
||||||
return self.success()
|
token = await self.ap.user_service.generate_jwt_token(user_email)
|
||||||
|
|
||||||
|
return self.success(data={
|
||||||
|
'token': token
|
||||||
|
})
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ class ComponentDiscoveryEngine:
|
|||||||
def get_components_by_kind(self, kind: str) -> typing.List[Component]:
|
def get_components_by_kind(self, kind: str) -> typing.List[Component]:
|
||||||
"""获取指定类型的组件"""
|
"""获取指定类型的组件"""
|
||||||
if kind not in self.components:
|
if kind not in self.components:
|
||||||
raise ValueError(f'No components found for kind: {kind}')
|
return []
|
||||||
return self.components[kind]
|
return self.components[kind]
|
||||||
|
|
||||||
def find_components(self, kind: str, component_list: typing.List[Component]) -> typing.List[Component]:
|
def find_components(self, kind: str, component_list: typing.List[Component]) -> typing.List[Component]:
|
||||||
|
|||||||
Reference in New Issue
Block a user