clerk #1

Merged
afiqzudinhadi merged 7 commits from clerk into main 2025-07-08 21:45:30 +08:00
5 changed files with 36 additions and 0 deletions
Showing only changes of commit e70d4d34c2 - Show all commits

3
packages/auth/helpers.ts Normal file
View file

@ -0,0 +1,3 @@
export function hasRole(userRoles: string[], role: string): boolean {
return userRoles.includes(role);
}

2
packages/auth/index.ts Normal file
View file

@ -0,0 +1,2 @@
export * from "./roles";
export * from "./helpers";

View file

@ -0,0 +1,12 @@
{
"name": "@repo/auth",
"version": "0.0.0",
"author": "Afiq Zudin Hadi",
"private": true,
"license": "MIT",
"main": "index.ts",
"type": "module",
"exports": {
"./indext.ts": "./index.ts"
}
}

5
packages/auth/roles.ts Normal file
View file

@ -0,0 +1,5 @@
export const ROLES = Object.freeze({
SUPER_ADMIN: "super_admin",
ADMIN: "admin",
USER: "user",
});

View file

@ -0,0 +1,14 @@
{
"extends": "@repo/typescript-config/base.json",
"compilerOptions": {
"lib": ["dom", "ES2015"],
"sourceMap": true,
"types": ["jest", "node"],
"baseUrl": ".",
"paths": {
"@repo/auth/index.ts": ["./index.ts"]
}
},
"include": [".", "src"],
"exclude": ["dist", "build", "node_modules"]
}