@a-tech.jo/auth-sdk 1.0.6 → 1.0.8
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 +10 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
# `@a-tech/auth-sdk`
|
|
1
|
+
# `@a-tech.jo/auth-sdk`
|
|
2
2
|
|
|
3
3
|
A full-stack, customizable authentication SDK providing seamless login, registration, and session management for A-Tech applications.
|
|
4
4
|
|
|
5
|
+
---
|
|
6
|
+
If you have any recommendations or needs, please contact us on our email
|
|
7
|
+
Email: support@a-tech.dev
|
|
8
|
+
Website: https://a-tech.dev
|
|
9
|
+
|
|
5
10
|
---
|
|
6
11
|
|
|
7
12
|
## Quick Start & Integration
|
|
@@ -10,7 +15,7 @@ A full-stack, customizable authentication SDK providing seamless login, registra
|
|
|
10
15
|
Import the pre-compiled CSS file in your root `layout.tsx` or `_app.tsx`:
|
|
11
16
|
|
|
12
17
|
```tsx
|
|
13
|
-
import "@a-tech/auth-sdk/styles.css";
|
|
18
|
+
import "@a-tech.jo/auth-sdk/styles.css";
|
|
14
19
|
|
|
15
20
|
```
|
|
16
21
|
|
|
@@ -50,7 +55,7 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
|
|
50
55
|
Render the pre-built, responsive authentication card supporting mode toggling (Login, Register, Forgot Password).
|
|
51
56
|
|
|
52
57
|
```tsx
|
|
53
|
-
import { SDKAuthContainer } from "@a-tech/auth-sdk";
|
|
58
|
+
import { SDKAuthContainer } from "@a-tech.jo/auth-sdk";
|
|
54
59
|
|
|
55
60
|
export default function AuthPage() {
|
|
56
61
|
const handleSuccess = (data: { user: any; token: string }) => {
|
|
@@ -73,7 +78,7 @@ export default function AuthPage() {
|
|
|
73
78
|
Access the current user profile, JWT token, and session utilities anywhere within the `AuthProvider` scope:
|
|
74
79
|
|
|
75
80
|
```tsx
|
|
76
|
-
import { useAuth } from "@a-tech/auth-sdk";
|
|
81
|
+
import { useAuth } from "@a-tech.jo/auth-sdk";
|
|
77
82
|
|
|
78
83
|
export default function Dashboard() {
|
|
79
84
|
const { user, token, logout, isExpired } = useAuth();
|
|
@@ -135,7 +140,7 @@ echo "//registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN" > .npmrc && npm publish -
|
|
|
135
140
|
Verify any JWT token and retrieve the active user profile using the SDK helper function:
|
|
136
141
|
|
|
137
142
|
```typescript
|
|
138
|
-
import { verifyToken } from "@a-tech/auth-sdk";
|
|
143
|
+
import { verifyToken } from "@a-tech.jo/auth-sdk";
|
|
139
144
|
|
|
140
145
|
async function validateSession(authToken: string) {
|
|
141
146
|
// Verifies token and returns session status & user details
|