forked from wishonia/wishonia
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The new AgentListPage component has been created as part of the "agents/mine" directory. This component, which incorporates AgentListMine, uses the getCurrentUser function and redirects to the sign-in page if there is no user data, improving security by enforcing authenticated access.
- Loading branch information
Showing
3 changed files
with
21 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react" | ||
import { redirect } from "next/navigation" | ||
|
||
import { authOptions } from "@/lib/auth" | ||
import { getCurrentUser } from "@/lib/session" | ||
import AgentListMine from "@/components/agents/agent-list-mine" | ||
import { Shell } from "@/components/layout/shell" | ||
|
||
export default async function AgentListPage() { | ||
const user = await getCurrentUser() | ||
if (!user) { | ||
redirect(authOptions?.pages?.signIn || "/signin") | ||
} | ||
return ( | ||
<Shell className="size-full"> | ||
<AgentListMine></AgentListMine> | ||
</Shell> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters