diff --git a/resources/pages/access/components/user-login-form.tsx b/resources/pages/access/components/user-login-form.tsx index c6baa2fd..abda08d6 100644 --- a/resources/pages/access/components/user-login-form.tsx +++ b/resources/pages/access/components/user-login-form.tsx @@ -17,6 +17,7 @@ import { FormControl, FormMessage, } from "@/components/ui/form" +import { Icons } from "@/components/icons" interface UserLoginFormProps extends React.HTMLAttributes {} const formSchema = z.object({ @@ -151,64 +152,20 @@ export function UserLoginForm({ className, ...props }: UserLoginFormProps) { + ) } diff --git a/resources/pages/access/components/user-registration-form.tsx b/resources/pages/access/components/user-registration-form.tsx index 0c05b5a6..6cff0a35 100644 --- a/resources/pages/access/components/user-registration-form.tsx +++ b/resources/pages/access/components/user-registration-form.tsx @@ -17,6 +17,7 @@ import { FormControl, FormMessage, } from "@/components/ui/form" +import { Icons } from "@/components/icons" interface UserRegistrationFormProps extends React.HTMLAttributes {} @@ -152,63 +153,19 @@ export function UserRegistrationForm({ + ) diff --git a/src/app/domain/accounts/guards.py b/src/app/domain/accounts/guards.py index 56b78f24..0d4daecd 100644 --- a/src/app/domain/accounts/guards.py +++ b/src/app/domain/accounts/guards.py @@ -104,6 +104,8 @@ async def current_user_from_token(token: Token, connection: ASGIConnection[Any, exclude=[ constants.OPENAPI_SCHEMA, constants.HEALTH_ENDPOINT, + urls.GITHUB_OAUTH2_CALLBACK, + urls.GOOGLE_OAUTH2_CALLBACK, urls.ACCOUNT_LOGIN, urls.ACCOUNT_REGISTER, ], diff --git a/src/app/domain/accounts/urls.py b/src/app/domain/accounts/urls.py index 278265a7..9f44b1cf 100644 --- a/src/app/domain/accounts/urls.py +++ b/src/app/domain/accounts/urls.py @@ -9,3 +9,5 @@ ACCOUNT_CREATE = "/api/users" ACCOUNT_ASSIGN_ROLE = "/api/roles/{role_slug:str}/assign" ACCOUNT_REVOKE_ROLE = "/api/roles/{role_slug:str}/revoke" +GITHUB_OAUTH2_CALLBACK = "/api/oauth/github/complete" +GOOGLE_OAUTH2_CALLBACK = "/api/oauth/google/complete" diff --git a/src/app/domain/teams/repositories.py b/src/app/domain/teams/repositories.py index 359cb6b6..454eed0c 100644 --- a/src/app/domain/teams/repositories.py +++ b/src/app/domain/teams/repositories.py @@ -33,12 +33,11 @@ async def get_user_teams( **kwargs: Any, ) -> tuple[list[Team], int]: """Get paginated list and total count of teams that a user can access.""" - + team_filter = select(TeamMember.id).where(TeamMember.user_id == user_id) return await self.list_and_count( *filters, + Team.id.in_(team_filter), statement=select(Team) - .join(TeamMember, onclause=Team.id == TeamMember.team_id, isouter=False) - .where(TeamMember.user_id == user_id) .order_by(Team.name) .options( selectinload(Team.tags),