@pantoia/auth-client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ React 훅을 쓰려면 React 18 이상이 필요하다.
|
|
|
19
19
|
```ts
|
|
20
20
|
import { createAuthClient } from "@pantoia/auth-client";
|
|
21
21
|
|
|
22
|
-
type Me = {
|
|
22
|
+
type Me = { name: string; permissions: string[] };
|
|
23
23
|
|
|
24
24
|
export const auth = createAuthClient<Me>({
|
|
25
25
|
baseUrl: "https://api.example.com",
|
|
@@ -93,7 +93,7 @@ import { useHasPermission, useMe } from "@pantoia/auth-client/react";
|
|
|
93
93
|
function Header() {
|
|
94
94
|
const me = useMe(auth);
|
|
95
95
|
const admin = useHasPermission(auth, "admin:app:view");
|
|
96
|
-
return <p>{me?.
|
|
96
|
+
return <p>{me?.name}</p>;
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|