Skip to content

Commit

Permalink
add auth for settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
zaviermiller committed Apr 22, 2024
1 parent 0ea3bb6 commit d44915e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { getAllUsers } from '@/server/actions/User';
import { adminAuth } from '@/utils/auth';
import SettingsView from '@/views/SettingsView';
import { redirect } from 'next/navigation';

export default async function SettingsPage() {
try {
await adminAuth();
} catch (e) {
redirect('/');
}
const users = await getAllUsers();
return <SettingsView users={users} />;
}

0 comments on commit d44915e

Please sign in to comment.