@tern-secure/nextjs 3.2.41 → 3.2.43
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 +34 -0
- package/dist/cjs/app-router/client/TernSecureProvider.js +1 -1
- package/dist/cjs/app-router/client/TernSecureProvider.js.map +1 -1
- package/dist/cjs/app-router/client/actions.js +52 -2
- package/dist/cjs/app-router/client/actions.js.map +1 -1
- package/dist/cjs/app-router/server/sessionTernSecure.js +21 -1
- package/dist/cjs/app-router/server/sessionTernSecure.js.map +1 -1
- package/dist/cjs/boundary/TernSecureClientProvider.js +1 -2
- package/dist/cjs/boundary/TernSecureClientProvider.js.map +1 -1
- package/dist/cjs/boundary/hooks/useAuth.js +0 -6
- package/dist/cjs/boundary/hooks/useAuth.js.map +1 -1
- package/dist/cjs/components/background.js +65 -0
- package/dist/cjs/components/background.js.map +1 -0
- package/dist/cjs/components/sign-in.js +162 -56
- package/dist/cjs/components/sign-in.js.map +1 -1
- package/dist/cjs/components/sign-out.js +69 -0
- package/dist/cjs/components/sign-out.js.map +1 -0
- package/dist/cjs/components/ui/alert.js +88 -0
- package/dist/cjs/components/ui/alert.js.map +1 -0
- package/dist/cjs/components/ui/button.js +84 -0
- package/dist/cjs/components/ui/button.js.map +1 -0
- package/dist/cjs/components/ui/card.js +101 -0
- package/dist/cjs/components/ui/card.js.map +1 -0
- package/dist/cjs/components/ui/input.js +58 -0
- package/dist/cjs/components/ui/input.js.map +1 -0
- package/dist/cjs/components/ui/label.js +55 -0
- package/dist/cjs/components/ui/label.js.map +1 -0
- package/dist/cjs/components/ui/separator.js +59 -0
- package/dist/cjs/components/ui/separator.js.map +1 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/utils.d.js +17 -0
- package/dist/cjs/lib/utils.d.js.map +1 -0
- package/dist/cjs/lib/utils.js +33 -0
- package/dist/cjs/lib/utils.js.map +1 -0
- package/dist/cjs/utils/client-init.js.map +1 -1
- package/dist/cjs/utils/construct.js +63 -0
- package/dist/cjs/utils/construct.js.map +1 -0
- package/dist/esm/app-router/client/TernSecureProvider.js +1 -1
- package/dist/esm/app-router/client/TernSecureProvider.js.map +1 -1
- package/dist/esm/app-router/client/actions.js +49 -2
- package/dist/esm/app-router/client/actions.js.map +1 -1
- package/dist/esm/app-router/server/sessionTernSecure.js +20 -1
- package/dist/esm/app-router/server/sessionTernSecure.js.map +1 -1
- package/dist/esm/boundary/TernSecureClientProvider.js +1 -2
- package/dist/esm/boundary/TernSecureClientProvider.js.map +1 -1
- package/dist/esm/boundary/hooks/useAuth.js +0 -6
- package/dist/esm/boundary/hooks/useAuth.js.map +1 -1
- package/dist/esm/components/background.js +41 -0
- package/dist/esm/components/background.js.map +1 -0
- package/dist/esm/components/sign-in.js +160 -54
- package/dist/esm/components/sign-in.js.map +1 -1
- package/dist/esm/components/sign-out.js +45 -0
- package/dist/esm/components/sign-out.js.map +1 -0
- package/dist/esm/components/ui/alert.js +52 -0
- package/dist/esm/components/ui/alert.js.map +1 -0
- package/dist/esm/components/ui/button.js +49 -0
- package/dist/esm/components/ui/button.js.map +1 -0
- package/dist/esm/components/ui/card.js +62 -0
- package/dist/esm/components/ui/card.js.map +1 -0
- package/dist/esm/components/ui/input.js +24 -0
- package/dist/esm/components/ui/input.js.map +1 -0
- package/dist/esm/components/ui/label.js +21 -0
- package/dist/esm/components/ui/label.js.map +1 -0
- package/dist/esm/components/ui/separator.js +25 -0
- package/dist/esm/components/ui/separator.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/utils.d.js +1 -0
- package/dist/esm/lib/utils.d.js.map +1 -0
- package/dist/esm/lib/utils.js +9 -0
- package/dist/esm/lib/utils.js.map +1 -0
- package/dist/esm/utils/client-init.js.map +1 -1
- package/dist/esm/utils/construct.js +37 -0
- package/dist/esm/utils/construct.js.map +1 -0
- package/dist/types/app-router/client/TernSecureProvider.d.ts +1 -1
- package/dist/types/app-router/client/TernSecureProvider.d.ts.map +1 -1
- package/dist/types/app-router/client/actions.d.ts +34 -0
- package/dist/types/app-router/client/actions.d.ts.map +1 -1
- package/dist/types/app-router/server/sessionTernSecure.d.ts +4 -0
- package/dist/types/app-router/server/sessionTernSecure.d.ts.map +1 -1
- package/dist/types/boundary/TernSecureClientProvider.d.ts.map +1 -1
- package/dist/types/boundary/hooks/useAuth.d.ts +0 -1
- package/dist/types/boundary/hooks/useAuth.d.ts.map +1 -1
- package/dist/types/components/background.d.ts +2 -0
- package/dist/types/components/background.d.ts.map +1 -0
- package/dist/types/components/sign-in.d.ts +8 -10
- package/dist/types/components/sign-in.d.ts.map +1 -1
- package/dist/types/components/sign-out.d.ts +10 -0
- package/dist/types/components/sign-out.d.ts.map +1 -0
- package/dist/types/components/ui/alert.d.ts +9 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +12 -0
- package/dist/types/components/ui/button.d.ts.map +1 -0
- package/dist/types/components/ui/card.d.ts +9 -0
- package/dist/types/components/ui/card.d.ts.map +1 -0
- package/dist/types/components/ui/input.d.ts +4 -0
- package/dist/types/components/ui/input.d.ts.map +1 -0
- package/dist/types/components/ui/label.d.ts +6 -0
- package/dist/types/components/ui/label.d.ts.map +1 -0
- package/dist/types/components/ui/separator.d.ts +5 -0
- package/dist/types/components/ui/separator.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/utils.d.ts +3 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/dist/types/utils/client-init.d.ts.map +1 -1
- package/dist/types/utils/construct.d.ts +22 -0
- package/dist/types/utils/construct.d.ts.map +1 -0
- package/package.json +79 -65
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var card_exports = {};
|
|
30
|
+
__export(card_exports, {
|
|
31
|
+
Card: () => Card,
|
|
32
|
+
CardContent: () => CardContent,
|
|
33
|
+
CardDescription: () => CardDescription,
|
|
34
|
+
CardFooter: () => CardFooter,
|
|
35
|
+
CardHeader: () => CardHeader,
|
|
36
|
+
CardTitle: () => CardTitle
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(card_exports);
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var React = __toESM(require("react"));
|
|
41
|
+
var import_utils = require("../../lib/utils");
|
|
42
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
className: (0, import_utils.cn)(
|
|
47
|
+
"rounded-xl border bg-card text-card-foreground shadow",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
));
|
|
53
|
+
Card.displayName = "Card";
|
|
54
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
className: (0, import_utils.cn)("flex flex-col space-y-1.5 p-6", className),
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
));
|
|
62
|
+
CardHeader.displayName = "CardHeader";
|
|
63
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
className: (0, import_utils.cn)("font-semibold leading-none tracking-tight", className),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
));
|
|
71
|
+
CardTitle.displayName = "CardTitle";
|
|
72
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
ref,
|
|
76
|
+
className: (0, import_utils.cn)("text-sm text-muted-foreground", className),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
CardDescription.displayName = "CardDescription";
|
|
81
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: (0, import_utils.cn)("p-6 pt-0", className), ...props }));
|
|
82
|
+
CardContent.displayName = "CardContent";
|
|
83
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
ref,
|
|
87
|
+
className: (0, import_utils.cn)("flex items-center p-6 pt-0", className),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
CardFooter.displayName = "CardFooter";
|
|
92
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
+
0 && (module.exports = {
|
|
94
|
+
Card,
|
|
95
|
+
CardContent,
|
|
96
|
+
CardDescription,
|
|
97
|
+
CardFooter,
|
|
98
|
+
CardHeader,
|
|
99
|
+
CardTitle
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border bg-card text-card-foreground shadow\",\n className\n )}\n {...props}\n />\n))\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQE;AARF,YAAuB;AAEvB,mBAAmB;AAEnB,MAAM,OAAO,MAAM,WAGjB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,KAAK,cAAc;AAEnB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;AAEzB,MAAM,YAAY,MAAM,WAGtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,6CAA6C,SAAS;AAAA,IACnE,GAAG;AAAA;AACN,CACD;AACD,UAAU,cAAc;AAExB,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAAc;AAE9B,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,4CAAC,SAAI,KAAU,eAAW,iBAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACjE;AACD,YAAY,cAAc;AAE1B,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,8BAA8B,SAAS;AAAA,IACpD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var input_exports = {};
|
|
30
|
+
__export(input_exports, {
|
|
31
|
+
Input: () => Input
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(input_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("../../lib/utils");
|
|
37
|
+
const Input = React.forwardRef(
|
|
38
|
+
({ className, type, ...props }, ref) => {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
type,
|
|
43
|
+
className: (0, import_utils.cn)(
|
|
44
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
ref,
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
Input.displayName = "Input";
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
Input
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM;AAPN,YAAuB;AAEvB,mBAAmB;AAEnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,MAAM,GAAG,MAAM,GAAG,QAAQ;AACtC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var label_exports = {};
|
|
30
|
+
__export(label_exports, {
|
|
31
|
+
Label: () => Label
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(label_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
37
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
38
|
+
var import_utils = require("../../lib/utils");
|
|
39
|
+
const labelVariants = (0, import_class_variance_authority.cva)(
|
|
40
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
41
|
+
);
|
|
42
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
LabelPrimitive.Root,
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
className: (0, import_utils.cn)(labelVariants(), className),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
));
|
|
50
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
Label
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/label.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeE;AAfF,YAAuB;AACvB,qBAAgC;AAChC,sCAAuC;AAEvC,mBAAmB;AAEnB,MAAM,oBAAgB;AAAA,EACpB;AACF;AAEA,MAAM,QAAQ,MAAM,WAIlB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,eAAe;AAAA,EAAf;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,cAAc,GAAG,SAAS;AAAA,IACvC,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc,eAAe,KAAK;","names":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var separator_exports = {};
|
|
30
|
+
__export(separator_exports, {
|
|
31
|
+
Separator: () => Separator
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(separator_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
37
|
+
var import_utils = require("../../lib/utils");
|
|
38
|
+
const Separator = React.forwardRef(
|
|
39
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
SeparatorPrimitive.Root,
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
decorative,
|
|
44
|
+
orientation,
|
|
45
|
+
className: (0, import_utils.cn)(
|
|
46
|
+
"shrink-0 bg-border",
|
|
47
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
Separator
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaI;AAbJ,YAAuB;AACvB,yBAAoC;AAEpC,mBAAmB;AAEnB,MAAM,YAAY,MAAM;AAAA,EAItB,CACE,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,MAAM,GACrE,QAEA;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eAAe,mBAAmB;AAAA,QAClD;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,UAAU,cAAc,mBAAmB,KAAK;","names":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var src_exports = {};
|
|
20
20
|
__export(src_exports, {
|
|
21
21
|
SignIn: () => import_sign_in.SignIn,
|
|
22
|
+
SignOut: () => import_sign_out.SignOut,
|
|
22
23
|
TernSecureAuth: () => import_client_init.TernSecureAuth,
|
|
23
24
|
TernSecureFirestore: () => import_client_init.TernSecureFirestore,
|
|
24
25
|
TernSecureProvider: () => import_TernSecureProvider.TernSecureProvider,
|
|
@@ -37,9 +38,11 @@ var import_TernSecureProvider = require("./app-router/client/TernSecureProvider"
|
|
|
37
38
|
var import_useAuth = require("./boundary/hooks/useAuth");
|
|
38
39
|
var import_useUser = require("./boundary/hooks/useUser");
|
|
39
40
|
var import_sign_in = require("./components/sign-in");
|
|
41
|
+
var import_sign_out = require("./components/sign-out");
|
|
40
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
43
|
0 && (module.exports = {
|
|
42
44
|
SignIn,
|
|
45
|
+
SignOut,
|
|
43
46
|
TernSecureAuth,
|
|
44
47
|
TernSecureFirestore,
|
|
45
48
|
TernSecureProvider,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["\r\n//import { TernSecureServerProvider } from './app-router/server/TernSecureServerProvider'\r\n//import type { TernSecureState } from './app-router/client/TernSecureProvider'\r\nexport { TernSecureAuth, TernSecureFirestore, ternSecureAuth } from './utils/client-init'\r\nexport { loadFireConfig, validateConfig } from './utils/config'\r\nexport { signInWithEmail } from './app-router/client/actions'\r\n//export { useInternalContext } from './boundary/TernSecureCtx'\r\n//export { TernSecureClientProvider } from './app-router/client/TernSecureProvider'\r\nexport { TernSecureProvider } from './app-router/client/TernSecureProvider'\r\nexport { useAuth } from './boundary/hooks/useAuth' \r\nexport { useUser } from './boundary/hooks/useUser'\r\nexport { SignIn } from './components/sign-in'\r\n\r\n//export const TernSecureProvider = TernSecureServerProvider\r\n//export type { TernSecureState }"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAAoE;AACpE,oBAA+C;AAC/C,qBAAgC;AAGhC,gCAAmC;AACnC,qBAAwB;AACxB,qBAAwB;AACxB,qBAAuB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["\r\n//import { TernSecureServerProvider } from './app-router/server/TernSecureServerProvider'\r\n//import type { TernSecureState } from './app-router/client/TernSecureProvider'\r\nexport { TernSecureAuth, TernSecureFirestore, ternSecureAuth } from './utils/client-init'\r\nexport { loadFireConfig, validateConfig } from './utils/config'\r\nexport { signInWithEmail } from './app-router/client/actions'\r\n//export { useInternalContext } from './boundary/TernSecureCtx'\r\n//export { TernSecureClientProvider } from './app-router/client/TernSecureProvider'\r\nexport { TernSecureProvider } from './app-router/client/TernSecureProvider'\r\nexport { useAuth } from './boundary/hooks/useAuth' \r\nexport { useUser } from './boundary/hooks/useUser'\r\nexport { SignIn } from './components/sign-in'\r\nexport { SignOut } from './components/sign-out'\r\n\r\n//export const TernSecureProvider = TernSecureServerProvider\r\n//export type { TernSecureState }"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAAoE;AACpE,oBAA+C;AAC/C,qBAAgC;AAGhC,gCAAmC;AACnC,qBAAwB;AACxB,qBAAwB;AACxB,qBAAuB;AACvB,sBAAwB;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var utils_d_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(utils_d_exports);
|
|
17
|
+
//# sourceMappingURL=utils.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\r\nimport { twMerge } from \"tailwind-merge\"\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs))\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;AAAA;;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
cn: () => cn
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
var import_clsx = require("clsx");
|
|
25
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
26
|
+
function cn(...inputs) {
|
|
27
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
cn
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\r\nimport { twMerge } from \"tailwind-merge\"\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs))\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/client-init.ts"],"sourcesContent":["import { initializeApp, getApps } from 'firebase/app';\r\nimport { getAuth, setPersistence, browserSessionPersistence } from 'firebase/auth';\r\nimport { getFirestore } from 'firebase/firestore';\r\nimport { getStorage } from 'firebase/storage';\r\nimport { initializeConfig} from './config';\r\n\r\n// Initialize immediately\r\nconst config = initializeConfig();\r\nconst clientApp = getApps().length === 0 ? initializeApp(config) : getApps()[0];\r\nexport const ternSecureAuth = getAuth(clientApp);\r\nsetPersistence(ternSecureAuth, browserSessionPersistence); //to change later user should be able to choose persistance\r\nconst firestore = getFirestore(clientApp);\r\nconst storage = getStorage(clientApp);\r\n\r\nexport const TernSecureAuth = () => ternSecureAuth;\r\nexport const TernSecureFirestore = () => firestore;\r\nexport const TernSecureStorage = () => storage;\r\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuC;AACvC,kBAAmE;AACnE,uBAA6B;AAC7B,qBAA2B;AAC3B,oBAAgC;AAGhC,MAAM,aAAS,gCAAiB;AAChC,MAAM,gBAAY,oBAAQ,EAAE,WAAW,QAAI,0BAAc,MAAM,QAAI,oBAAQ,EAAE,CAAC;AACvE,MAAM,qBAAiB,qBAAQ,SAAS;AAAA,IAC/C,4BAAe,gBAAgB,qCAAyB;AACxD,MAAM,gBAAY,+BAAa,SAAS;AACxC,MAAM,cAAU,2BAAW,SAAS;
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/client-init.ts"],"sourcesContent":["import { initializeApp, getApps } from 'firebase/app';\r\nimport { getAuth, setPersistence, browserSessionPersistence } from 'firebase/auth';\r\nimport { getFirestore } from 'firebase/firestore';\r\nimport { getStorage } from 'firebase/storage';\r\nimport { initializeConfig} from './config';\r\n\r\n// Initialize immediately\r\nconst config = initializeConfig();\r\nconst clientApp = getApps().length === 0 ? initializeApp(config) : getApps()[0];\r\nexport const ternSecureAuth = getAuth(clientApp);\r\nsetPersistence(ternSecureAuth, browserSessionPersistence); //to change later user should be able to choose persistance\r\nconst firestore = getFirestore(clientApp);\r\nconst storage = getStorage(clientApp);\r\n\r\n\r\n\r\nexport const TernSecureAuth = () => ternSecureAuth;\r\nexport const TernSecureFirestore = () => firestore;\r\nexport const TernSecureStorage = () => storage;\r\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuC;AACvC,kBAAmE;AACnE,uBAA6B;AAC7B,qBAA2B;AAC3B,oBAAgC;AAGhC,MAAM,aAAS,gCAAiB;AAChC,MAAM,gBAAY,oBAAQ,EAAE,WAAW,QAAI,0BAAc,MAAM,QAAI,oBAAQ,EAAE,CAAC;AACvE,MAAM,qBAAiB,qBAAQ,SAAS;AAAA,IAC/C,4BAAe,gBAAgB,qCAAyB;AACxD,MAAM,gBAAY,+BAAa,SAAS;AACxC,MAAM,cAAU,2BAAW,SAAS;AAI7B,MAAM,iBAAiB,MAAM;AAC7B,MAAM,sBAAsB,MAAM;AAClC,MAAM,oBAAoB,MAAM;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var construct_exports = {};
|
|
20
|
+
__export(construct_exports, {
|
|
21
|
+
constructFullUrl: () => constructFullUrl,
|
|
22
|
+
constructUrlWithRedirect: () => constructUrlWithRedirect,
|
|
23
|
+
getValidRedirectUrl: () => getValidRedirectUrl
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(construct_exports);
|
|
26
|
+
const constructFullUrl = (path) => {
|
|
27
|
+
const baseUrl = window.location.origin;
|
|
28
|
+
if (path.startsWith("http")) {
|
|
29
|
+
return path;
|
|
30
|
+
}
|
|
31
|
+
return `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
32
|
+
};
|
|
33
|
+
const constructUrlWithRedirect = (path, redirectUrl, loginPath) => {
|
|
34
|
+
const url = new URL(path, window.location.origin);
|
|
35
|
+
if (redirectUrl && !redirectUrl.startsWith(loginPath)) {
|
|
36
|
+
const fullRedirectUrl = redirectUrl.startsWith("http") ? redirectUrl : constructFullUrl(redirectUrl);
|
|
37
|
+
url.searchParams.set("redirect_url", fullRedirectUrl);
|
|
38
|
+
}
|
|
39
|
+
return url.toString();
|
|
40
|
+
};
|
|
41
|
+
const getValidRedirectUrl = (redirectUrl, searchParams) => {
|
|
42
|
+
const redirect = redirectUrl || searchParams.get("redirect_url") || "/";
|
|
43
|
+
try {
|
|
44
|
+
if (redirect.startsWith("http")) {
|
|
45
|
+
const url = new URL(redirect);
|
|
46
|
+
if (url.origin === window.location.origin) {
|
|
47
|
+
return redirect;
|
|
48
|
+
}
|
|
49
|
+
return "/";
|
|
50
|
+
}
|
|
51
|
+
return constructFullUrl(redirect);
|
|
52
|
+
} catch (e) {
|
|
53
|
+
console.error("Invalid redirect URL:", e);
|
|
54
|
+
return constructFullUrl("/");
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
constructFullUrl,
|
|
60
|
+
constructUrlWithRedirect,
|
|
61
|
+
getValidRedirectUrl
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=construct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/construct.ts"],"sourcesContent":["/**\r\n * Constructs a full URL with the current origin\r\n * @param path - The path to construct the URL for\r\n * @returns The full URL with origin\r\n */\r\nexport const constructFullUrl = (path: string) => {\r\n const baseUrl = window.location.origin\r\n if (path.startsWith('http')) {\r\n return path\r\n }\r\n return `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`\r\n }\r\n \r\n /**\r\n * Constructs a URL with redirect parameters\r\n * @param path - The base path (usually login path)\r\n * @param redirectUrl - The URL to redirect to after action completes\r\n * @param loginPath - The login path to check against\r\n * @returns The full URL with redirect parameters\r\n */\r\n export const constructUrlWithRedirect = (path: string, redirectUrl: string, loginPath: string) => {\r\n // Create the URL with the full origin\r\n const url = new URL(path, window.location.origin)\r\n \r\n // Add redirect parameter if provided and not redirecting to login\r\n if (redirectUrl && !redirectUrl.startsWith(loginPath)) {\r\n // Ensure redirect URL is also absolute if it's not already\r\n const fullRedirectUrl = redirectUrl.startsWith('http') \r\n ? redirectUrl \r\n : constructFullUrl(redirectUrl)\r\n \r\n url.searchParams.set('redirect_url', fullRedirectUrl)\r\n }\r\n \r\n return url.toString()\r\n }\r\n \r\n /**\r\n * Gets a validated redirect URL ensuring it's from the same origin\r\n * @param redirectUrl - The URL to validate\r\n * @param searchParams - The search parameters to check for redirect_url\r\n * @returns A validated redirect URL\r\n */\r\n export const getValidRedirectUrl = (\r\n redirectUrl: string | undefined,\r\n searchParams: URLSearchParams\r\n ): string => {\r\n const redirect = redirectUrl || searchParams.get('redirect_url') || '/'\r\n \r\n try {\r\n if (redirect.startsWith('http')) {\r\n const url = new URL(redirect)\r\n if (url.origin === window.location.origin) {\r\n return redirect\r\n }\r\n return '/'\r\n }\r\n return constructFullUrl(redirect)\r\n } catch (e) {\r\n console.error('Invalid redirect URL:', e)\r\n return constructFullUrl('/')\r\n }\r\n }\r\n \r\n "],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,mBAAmB,CAAC,SAAiB;AAC9C,QAAM,UAAU,OAAO,SAAS;AAChC,MAAI,KAAK,WAAW,MAAM,GAAG;AAC3B,WAAO;AAAA,EACT;AACA,SAAO,GAAG,OAAO,GAAG,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI,EAAE;AAC9D;AASO,MAAM,2BAA2B,CAAC,MAAc,aAAqB,cAAsB;AAEhG,QAAM,MAAM,IAAI,IAAI,MAAM,OAAO,SAAS,MAAM;AAGhD,MAAI,eAAe,CAAC,YAAY,WAAW,SAAS,GAAG;AAErD,UAAM,kBAAkB,YAAY,WAAW,MAAM,IACjD,cACA,iBAAiB,WAAW;AAEhC,QAAI,aAAa,IAAI,gBAAgB,eAAe;AAAA,EACtD;AAEA,SAAO,IAAI,SAAS;AACtB;AAQO,MAAM,sBAAsB,CACjC,aACA,iBACW;AACX,QAAM,WAAW,eAAe,aAAa,IAAI,cAAc,KAAK;AAEpE,MAAI;AACF,QAAI,SAAS,WAAW,MAAM,GAAG;AAC/B,YAAM,MAAM,IAAI,IAAI,QAAQ;AAC5B,UAAI,IAAI,WAAW,OAAO,SAAS,QAAQ;AACzC,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AACA,WAAO,iBAAiB,QAAQ;AAAA,EAClC,SAAS,GAAG;AACV,YAAQ,MAAM,yBAAyB,CAAC;AACxC,WAAO,iBAAiB,GAAG;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { TernSecureClientProvider } from "../../boundary/TernSecureClientProvider";
|
|
3
|
-
function TernSecureProvider({ children }) {
|
|
3
|
+
async function TernSecureProvider({ children }) {
|
|
4
4
|
return /* @__PURE__ */ jsx(TernSecureClientProvider, { children });
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/app-router/client/TernSecureProvider.tsx"],"sourcesContent":["import React from \"react\"\r\nimport { TernSecureClientProvider } from \"../../boundary/TernSecureClientProvider\"\r\n\r\n\r\n// Loading fallback component\r\n/*function TernSecureLoadingFallback() {\r\n return (\r\n <div>\r\n <span className=\"sr-only\">Loading...</span>\r\n </div>\r\n )\r\n}*/\r\n/**\r\n * Root Provider for TernSecure\r\n * Use this in your Next.js App Router root layout\r\n * Automatically handles client/server boundary and authentication state\r\n * \r\n * @example\r\n * // app/layout.tsx\r\n * import { TernSecureProvider } from '@tern/secure'\r\n * \r\n * export default function RootLayout({ children }) {\r\n * return (\r\n * <html>\r\n * <body>\r\n * <TernSecureProvider>\r\n * {children}\r\n * </TernSecureProvider>\r\n * </body>\r\n * </html>\r\n * )\r\n * }\r\n */\r\nexport function TernSecureProvider({ children }: { children: React.ReactNode }) {\r\n return (\r\n <TernSecureClientProvider>\r\n {children}\r\n </TernSecureClientProvider>\r\n )\r\n}"],"mappings":"AAmCI;AAlCJ,SAAS,gCAAgC;
|
|
1
|
+
{"version":3,"sources":["../../../../src/app-router/client/TernSecureProvider.tsx"],"sourcesContent":["import React from \"react\"\r\nimport { TernSecureClientProvider } from \"../../boundary/TernSecureClientProvider\"\r\n\r\n\r\n// Loading fallback component\r\n/*function TernSecureLoadingFallback() {\r\n return (\r\n <div>\r\n <span className=\"sr-only\">Loading...</span>\r\n </div>\r\n )\r\n}*/\r\n/**\r\n * Root Provider for TernSecure\r\n * Use this in your Next.js App Router root layout\r\n * Automatically handles client/server boundary and authentication state\r\n * \r\n * @example\r\n * // app/layout.tsx\r\n * import { TernSecureProvider } from '@tern/secure'\r\n * \r\n * export default function RootLayout({ children }) {\r\n * return (\r\n * <html>\r\n * <body>\r\n * <TernSecureProvider>\r\n * {children}\r\n * </TernSecureProvider>\r\n * </body>\r\n * </html>\r\n * )\r\n * }\r\n */\r\nexport async function TernSecureProvider({ children }: { children: React.ReactNode }) {\r\n return (\r\n <TernSecureClientProvider>\r\n {children}\r\n </TernSecureClientProvider>\r\n )\r\n}"],"mappings":"AAmCI;AAlCJ,SAAS,gCAAgC;AAgCzC,eAAsB,mBAAmB,EAAE,SAAS,GAAkC;AACpF,SACE,oBAAC,4BACI,UACL;AAEJ;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TernSecureAuth } from "../../utils/client-init";
|
|
2
|
-
import { signInWithEmailAndPassword } from "firebase/auth";
|
|
2
|
+
import { signInWithEmailAndPassword, signInWithRedirect, getRedirectResult, GoogleAuthProvider, OAuthProvider } from "firebase/auth";
|
|
3
3
|
import { createSessionCookie } from "../server/sessionTernSecure";
|
|
4
4
|
async function signInWithEmail(email, password) {
|
|
5
5
|
const auth = TernSecureAuth();
|
|
@@ -17,7 +17,54 @@ async function signInWithEmail(email, password) {
|
|
|
17
17
|
throw new Error(errorMessage);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async function signInWithRedirectGoogle() {
|
|
21
|
+
const auth = TernSecureAuth();
|
|
22
|
+
const provider = new GoogleAuthProvider();
|
|
23
|
+
provider.setCustomParameters({
|
|
24
|
+
login_hint: "user@example.com",
|
|
25
|
+
prompt: "select_account"
|
|
26
|
+
});
|
|
27
|
+
try {
|
|
28
|
+
await signInWithRedirect(auth, provider);
|
|
29
|
+
return { success: true, message: "Redirect initiated" };
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error("Error during Google sign-in:", error);
|
|
32
|
+
return { success: false, error: "Failed to sign in with Google" };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function signInWithMicrosoft() {
|
|
36
|
+
const auth = TernSecureAuth();
|
|
37
|
+
const provider = new OAuthProvider("microsoft.com");
|
|
38
|
+
provider.setCustomParameters({
|
|
39
|
+
prompt: "consent"
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
await signInWithRedirect(auth, provider);
|
|
43
|
+
return { success: true, message: "Redirect initiated" };
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error("Error during Google sign-in:", error);
|
|
46
|
+
return { success: false, error: "Failed to sign in with Google" };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function handleAuthRedirectResult() {
|
|
50
|
+
const auth = TernSecureAuth();
|
|
51
|
+
try {
|
|
52
|
+
const result = await getRedirectResult(auth);
|
|
53
|
+
if (result) {
|
|
54
|
+
const user = result.user;
|
|
55
|
+
return { success: true, user };
|
|
56
|
+
} else {
|
|
57
|
+
return { success: false, error: "No redirect result" };
|
|
58
|
+
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error("Error handling auth redirect result:", error);
|
|
61
|
+
return { success: false, error: error.message || "Failed to handle auth redirect", code: error.code };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
20
64
|
export {
|
|
21
|
-
|
|
65
|
+
handleAuthRedirectResult,
|
|
66
|
+
signInWithEmail,
|
|
67
|
+
signInWithMicrosoft,
|
|
68
|
+
signInWithRedirectGoogle
|
|
22
69
|
};
|
|
23
70
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/app-router/client/actions.ts"],"sourcesContent":["import { TernSecureAuth } from '../../utils/client-init'\r\nimport { signInWithEmailAndPassword } from 'firebase/auth'\r\nimport { createSessionCookie } from '../server/sessionTernSecure'\r\n\r\n\r\nexport async function signInWithEmail(email: string, password: string){\r\n const auth = TernSecureAuth()\r\n try {\r\n const UserCredential = await signInWithEmailAndPassword(auth, email, password)\r\n const idToken = await UserCredential.user.getIdToken();\r\n\r\n const res = await createSessionCookie(idToken);\r\n\r\n if(res.success) {\r\n return { success: true, message: 'Connected.' };\r\n } else {\r\n throw new Error(res.message);\r\n }\r\n} catch (error){\r\n const errorMessage = error instanceof Error ? error.message : 'Failed to sign in';\r\n throw new Error(errorMessage);\r\n}\r\n} "],"mappings":"AAAA,SAAS,sBAAsB;AAC/B,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../../../src/app-router/client/actions.ts"],"sourcesContent":["import { TernSecureAuth } from '../../utils/client-init'\r\nimport { signInWithEmailAndPassword, signInWithRedirect, getRedirectResult, GoogleAuthProvider, OAuthProvider } from 'firebase/auth'\r\nimport { createSessionCookie } from '../server/sessionTernSecure'\r\n\r\n\r\nexport async function signInWithEmail(email: string, password: string){\r\n const auth = TernSecureAuth()\r\n try {\r\n const UserCredential = await signInWithEmailAndPassword(auth, email, password)\r\n const idToken = await UserCredential.user.getIdToken();\r\n\r\n const res = await createSessionCookie(idToken);\r\n\r\n if(res.success) {\r\n return { success: true, message: 'Connected.' };\r\n } else {\r\n throw new Error(res.message);\r\n }\r\n} catch (error){\r\n const errorMessage = error instanceof Error ? error.message : 'Failed to sign in';\r\n throw new Error(errorMessage);\r\n}\r\n} \r\n\r\nexport async function signInWithRedirectGoogle() {\r\n const auth = TernSecureAuth()\r\n const provider = new GoogleAuthProvider()\r\n provider.setCustomParameters({\r\n login_hint: 'user@example.com',\r\n prompt: 'select_account'\r\n })\r\n\r\n try {\r\n await signInWithRedirect(auth, provider)\r\n return { success: true, message: 'Redirect initiated' }\r\n } catch (error) {\r\n console.error('Error during Google sign-in:', error)\r\n return { success: false, error: 'Failed to sign in with Google' }\r\n }\r\n}\r\n\r\n\r\nexport async function signInWithMicrosoft() {\r\n const auth = TernSecureAuth()\r\n const provider = new OAuthProvider('microsoft.com')\r\n provider.setCustomParameters({\r\n prompt: 'consent'\r\n })\r\n\r\n try {\r\n await signInWithRedirect(auth, provider)\r\n return { success: true, message: 'Redirect initiated' }\r\n } catch (error) {\r\n console.error('Error during Google sign-in:', error)\r\n return { success: false, error: 'Failed to sign in with Google' }\r\n }\r\n}\r\n\r\n\r\nexport async function handleAuthRedirectResult() {\r\n const auth = TernSecureAuth()\r\n try {\r\n const result = await getRedirectResult(auth)\r\n if (result) {\r\n const user = result.user\r\n return { success: true, user }\r\n } else {\r\n return { success: false, error: 'No redirect result' }\r\n }\r\n } catch (error: any) {\r\n console.error('Error handling auth redirect result:', error)\r\n return { success: false, error: error.message || 'Failed to handle auth redirect', code: error.code }\r\n }\r\n}"],"mappings":"AAAA,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B,oBAAoB,mBAAmB,oBAAoB,qBAAqB;AACrH,SAAS,2BAA2B;AAGpC,eAAsB,gBAAgB,OAAe,UAAiB;AACpE,QAAM,OAAO,eAAe;AAC5B,MAAI;AACJ,UAAM,iBAAiB,MAAM,2BAA2B,MAAM,OAAO,QAAQ;AAC7E,UAAM,UAAU,MAAM,eAAe,KAAK,WAAW;AAErD,UAAM,MAAM,MAAM,oBAAoB,OAAO;AAE7C,QAAG,IAAI,SAAS;AACd,aAAO,EAAE,SAAS,MAAM,SAAS,aAAa;AAAA,IAChD,OAAO;AACL,YAAM,IAAI,MAAM,IAAI,OAAO;AAAA,IAC7B;AAAA,EACF,SAAS,OAAM;AACb,UAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU;AAC9D,UAAM,IAAI,MAAM,YAAY;AAAA,EAC9B;AACA;AAEA,eAAsB,2BAA2B;AAC/C,QAAM,OAAO,eAAe;AAC5B,QAAM,WAAW,IAAI,mBAAmB;AACxC,WAAS,oBAAoB;AAAA,IAC3B,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV,CAAC;AAED,MAAI;AACF,UAAM,mBAAmB,MAAM,QAAQ;AACvC,WAAO,EAAE,SAAS,MAAM,SAAS,qBAAqB;AAAA,EACxD,SAAS,OAAO;AACd,YAAQ,MAAM,gCAAgC,KAAK;AACnD,WAAO,EAAE,SAAS,OAAO,OAAO,gCAAgC;AAAA,EAClE;AACF;AAGA,eAAsB,sBAAsB;AAC1C,QAAM,OAAO,eAAe;AAC5B,QAAM,WAAW,IAAI,cAAc,eAAe;AAClD,WAAS,oBAAoB;AAAA,IAC3B,QAAQ;AAAA,EACV,CAAC;AAED,MAAI;AACF,UAAM,mBAAmB,MAAM,QAAQ;AACvC,WAAO,EAAE,SAAS,MAAM,SAAS,qBAAqB;AAAA,EACxD,SAAS,OAAO;AACd,YAAQ,MAAM,gCAAgC,KAAK;AACnD,WAAO,EAAE,SAAS,OAAO,OAAO,gCAAgC;AAAA,EAClE;AACF;AAGA,eAAsB,2BAA2B;AAC/C,QAAM,OAAO,eAAe;AAC5B,MAAI;AACF,UAAM,SAAS,MAAM,kBAAkB,IAAI;AAC3C,QAAI,QAAQ;AACV,YAAM,OAAO,OAAO;AACpB,aAAO,EAAE,SAAS,MAAM,KAAK;AAAA,IAC/B,OAAO;AACL,aAAO,EAAE,SAAS,OAAO,OAAO,qBAAqB;AAAA,IACvD;AAAA,EACF,SAAS,OAAY;AACnB,YAAQ,MAAM,wCAAwC,KAAK;AAC3D,WAAO,EAAE,SAAS,OAAO,OAAO,MAAM,WAAW,kCAAkC,MAAM,MAAM,KAAK;AAAA,EACtG;AACF;","names":[]}
|
|
@@ -66,7 +66,7 @@ async function setServerSession(token) {
|
|
|
66
66
|
}
|
|
67
67
|
async function verifyTernIdToken(token) {
|
|
68
68
|
try {
|
|
69
|
-
const decodedToken = await adminAuth.verifyIdToken(token);
|
|
69
|
+
const decodedToken = await adminAuth.verifyIdToken(token, true);
|
|
70
70
|
return { valid: true, uid: decodedToken.uid };
|
|
71
71
|
} catch (error) {
|
|
72
72
|
if (error instanceof Error) {
|
|
@@ -99,7 +99,26 @@ async function verifyTernSessionCookie(session) {
|
|
|
99
99
|
return { error, valid: false };
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
+
async function clearSessionCookie() {
|
|
103
|
+
var _a;
|
|
104
|
+
const cookieStore = await cookies();
|
|
105
|
+
cookieStore.delete("_session_cookie");
|
|
106
|
+
cookieStore.delete("_session_token");
|
|
107
|
+
cookieStore.delete("_session");
|
|
108
|
+
try {
|
|
109
|
+
const sessionCookie = (_a = cookieStore.get("_session_cookie")) == null ? void 0 : _a.value;
|
|
110
|
+
if (sessionCookie) {
|
|
111
|
+
const decodedClaims = await adminAuth.verifySessionCookie(sessionCookie);
|
|
112
|
+
await adminAuth.revokeRefreshTokens(decodedClaims.uid);
|
|
113
|
+
}
|
|
114
|
+
return { success: true, message: "Session cleared successfully" };
|
|
115
|
+
} catch (error) {
|
|
116
|
+
console.error("Error clearing session:", error);
|
|
117
|
+
return { success: true, message: "Session cookies cleared" };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
102
120
|
export {
|
|
121
|
+
clearSessionCookie,
|
|
103
122
|
createSessionCookie,
|
|
104
123
|
getIdToken,
|
|
105
124
|
getServerSessionCookie,
|