@sqrzro/auth 2.0.0-bz.1 → 2.0.0-bz.3
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/.turbo/turbo-build.log
CHANGED
|
File without changes
|
|
@@ -34,11 +34,12 @@ function getPage(route, props) {
|
|
|
34
34
|
* client components. So we have to pass the classNames directly to the component.
|
|
35
35
|
*/
|
|
36
36
|
async function Auth({ classNames, logo, onLogin, onPassword, params: { auth }, searchParams, }) {
|
|
37
|
+
console.log('auth', auth);
|
|
37
38
|
if (auth.length > 1) {
|
|
38
39
|
return notFound();
|
|
39
40
|
}
|
|
40
41
|
await registerAuthEvents({ login: onLogin, password: onPassword });
|
|
41
|
-
return (_jsxs("div", { className: tw(
|
|
42
|
+
return (_jsxs("div", { className: tw(classNames?.root), children: [_jsx("div", { className: tw(classNames?.logo), children: logo }), _jsx("div", { className: tw(classNames?.panel), children: getPage(auth[0], {
|
|
42
43
|
classNames,
|
|
43
44
|
searchParams,
|
|
44
45
|
}) })] }));
|
|
@@ -7,6 +7,8 @@ function LogoutButton({ children = 'Log out', redirectTo, }) {
|
|
|
7
7
|
async function handleLogout() {
|
|
8
8
|
await logout();
|
|
9
9
|
router.push(redirectTo || '/');
|
|
10
|
+
// It seems necessary to refresh to ensure the user is redirected to the login page
|
|
11
|
+
router.refresh();
|
|
10
12
|
}
|
|
11
13
|
return (_jsx("form", { action: handleLogout, className: "contents", children: _jsx("button", { type: "submit", children: children }) }));
|
|
12
14
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqrzro/auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-bz.
|
|
4
|
+
"version": "2.0.0-bz.3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"typescript": "^5.4.4"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "tsc -p tsconfig.json"
|
|
20
|
+
"build": "tsc -p tsconfig.json",
|
|
21
|
+
"dev": "tsc -p tsconfig.json --watch",
|
|
22
|
+
"start": "pnpm dev"
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -18,6 +18,9 @@ function LogoutButton({
|
|
|
18
18
|
async function handleLogout(): Promise<void> {
|
|
19
19
|
await logout();
|
|
20
20
|
router.push(redirectTo || '/');
|
|
21
|
+
|
|
22
|
+
// It seems necessary to refresh to ensure the user is redirected to the login page
|
|
23
|
+
router.refresh();
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
return (
|