-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Installed server-only and next-auth * MS: endpoint for fetching ability rules * MS2: implemented nextauth and refacored auth code * Use nextauth cookies for auth in old ms * Example .env.local file * Changed page to be rendered on the server * Double submit cookie csrf protection * Local development users * Transformed page to be a server component * use environments for auth and auth0 is optional in dev * Enabled redirects in AuthCan * Added missing commands * Feature flag for auth0 + ms api script * Fallback user avatar * Updated readme * Fixed typos
- Loading branch information
1 parent
54bc2f9
commit 5c3a8c0
Showing
49 changed files
with
1,268 additions
and
953 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
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,7 @@ | ||
NEXTAUTH_URL= | ||
NEXTAUTH_SECRET= | ||
|
||
AUTH0_CLIENT_ID= | ||
AUTH0_CLIENT_SECRET= | ||
AUTH0_ISSUER= | ||
AUTH0_SCOPE= |
67 changes: 2 additions & 65 deletions
67
src/management-system-v2/app/(dashboard)/iam/roles/[roleId]/page.tsx
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
68 changes: 68 additions & 0 deletions
68
src/management-system-v2/app/(dashboard)/iam/roles/[roleId]/role-page.tsx
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,68 @@ | ||
'use client'; | ||
|
||
import Content from '@/components/content'; | ||
import { useGetAsset } from '@/lib/fetch-data'; | ||
import { Button, Result, Skeleton, Space, Tabs } from 'antd'; | ||
import { LeftOutlined } from '@ant-design/icons'; | ||
import { ComponentProps } from 'react'; | ||
import RoleGeneralData from './roleGeneralData'; | ||
import { useRouter } from 'next/navigation'; | ||
import RolePermissions from './rolePermissions'; | ||
import RoleMembers from './role-members'; | ||
|
||
type Items = ComponentProps<typeof Tabs>['items']; | ||
|
||
function RolePage({ params: { roleId } }: { params: { roleId: string } }) { | ||
const router = useRouter(); | ||
const { | ||
data: role, | ||
isLoading, | ||
error, | ||
} = useGetAsset('/roles/{id}', { | ||
params: { path: { id: roleId } }, | ||
}); | ||
|
||
const items: Items = role | ||
? [ | ||
{ | ||
key: 'members', | ||
label: 'Manage Members', | ||
children: <RoleMembers role={role} isLoadingRole={isLoading} />, | ||
}, | ||
{ key: 'permissions', label: 'Permissions', children: <RolePermissions role={role} /> }, | ||
{ | ||
key: 'generalData', | ||
label: 'General Data', | ||
children: <RoleGeneralData roleId={roleId} />, | ||
}, | ||
] | ||
: []; | ||
|
||
if (error) | ||
return ( | ||
<Result | ||
status="error" | ||
title="Failed to fetch role" | ||
subTitle="An error ocurred while fetching role, please try again." | ||
/> | ||
); | ||
|
||
return ( | ||
<Content | ||
title={ | ||
<Space> | ||
<Button icon={<LeftOutlined />} onClick={() => router.push('/iam/roles')} type="text"> | ||
Back | ||
</Button> | ||
{role?.name} | ||
</Space> | ||
} | ||
> | ||
<Skeleton loading={isLoading}> | ||
<Tabs items={items} /> | ||
</Skeleton> | ||
</Content> | ||
); | ||
} | ||
|
||
export default RolePage; |
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
6 changes: 3 additions & 3 deletions
6
src/management-system-v2/app/(dashboard)/iam/roles/header-actions.tsx
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
146 changes: 2 additions & 144 deletions
146
src/management-system-v2/app/(dashboard)/iam/roles/page.tsx
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
Oops, something went wrong.