@tern-secure/nextjs 2.0.8 → 2.0.9

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/dist/index.js CHANGED
@@ -1,6 +1,233 @@
1
- import { TernSecureAuth, TernSecureFirestore, TernSecureStorage } from "./app-router/client";
2
- import { TernSecureProvider } from "./app-router/server";
3
- import { useAuth } from "./hooks/";
4
- import { SignIn } from "./components";
5
- export { TernSecureProvider, useAuth, SignIn, TernSecureAuth, TernSecureFirestore, TernSecureStorage };
6
- //# sourceMappingURL=index.js.map
1
+ import * as React from 'react';
2
+ import React__default, { createContext, useContext, useState, useEffect } from 'react';
3
+ import { getApps, initializeApp } from 'firebase/app';
4
+ import { getAuth, setPersistence, browserSessionPersistence, signInWithEmailAndPassword } from 'firebase/auth';
5
+ import { getFirestore } from 'firebase/firestore';
6
+ import { getStorage } from 'firebase/storage';
7
+ import dynamic from 'next/dynamic';
8
+
9
+ // Initialize immediately
10
+ const app = (() => {
11
+ const config = validateConfig(loadFireConfig());
12
+ return getApps().length ? getApps()[0] : initializeApp(config);
13
+ })();
14
+ const auth = getAuth(app);
15
+ setPersistence(auth, browserSessionPersistence); //to change later user should be able to choose persistance
16
+ const firestore = getFirestore(app);
17
+ const storage = getStorage(app);
18
+ const TernSecureAuth = () => auth;
19
+ const TernSecureFirestore = () => firestore;
20
+ const TernSecureStorage = () => storage;
21
+
22
+ async function signInWithEmail({ email, password }) {
23
+ const auth = TernSecureAuth();
24
+ return signInWithEmailAndPassword(auth, email, password);
25
+ }
26
+
27
+ const loadFireConfig = () => ({
28
+ apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
29
+ authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
30
+ projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
31
+ storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
32
+ messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
33
+ appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
34
+ measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
35
+ });
36
+ const validateConfig = (config) => {
37
+ Object.entries(config).forEach(([key, value]) => {
38
+ if (!value) {
39
+ throw new Error(`Missing environment variable: NEXT_PUBLIC_FIREBASE_${key.toUpperCase()}`);
40
+ }
41
+ });
42
+ return config;
43
+ };
44
+
45
+ const createTernSecureContext = () => {
46
+ const initialState = {
47
+ firebase: {
48
+ initialized: false,
49
+ error: null
50
+ },
51
+ auth: {
52
+ user: null,
53
+ loading: true,
54
+ error: null,
55
+ isSignedIn: false
56
+ }
57
+ };
58
+ return createContext([initialState, () => { }]);
59
+ };
60
+ // Create context instance only when imported on client
61
+ const TernSecureContext = createTernSecureContext();
62
+ const useTernSecure = (hookname) => {
63
+ const context = useContext(TernSecureContext);
64
+ if (!context) {
65
+ throw new Error(`${hookname} must be used within TernSecureProvider`);
66
+ }
67
+ return context;
68
+ };
69
+ // Export initial state for reuse
70
+ const initialState = {
71
+ firebase: {
72
+ initialized: false,
73
+ error: null
74
+ },
75
+ auth: {
76
+ user: null,
77
+ loading: true,
78
+ error: null,
79
+ isSignedIn: false
80
+ }
81
+ };
82
+
83
+ function TernSecureClientProvider$1({ children }) {
84
+ const stateAndUpdater = useState(initialState);
85
+ return (React__default.createElement(TernSecureContext.Provider, { value: stateAndUpdater }, children));
86
+ }
87
+
88
+ var ternSecureClientProvider = /*#__PURE__*/Object.freeze({
89
+ __proto__: null,
90
+ TernSecureClientProvider: TernSecureClientProvider$1
91
+ });
92
+
93
+ // Dynamically import the client provider with no SSR
94
+ const TernSecureClientProvider = dynamic(() => Promise.resolve().then(function () { return ternSecureClientProvider; }).then(mod => mod.TernSecureClientProvider), {
95
+ //ssr: false,
96
+ loading: () => null // Return null or a loading indicator
97
+ });
98
+ function TernSecureProvider({ children }) {
99
+ // Check if the children contain html/body tags
100
+ const isRootLayout = React__default.Children.toArray(children).some(child => React__default.isValidElement(child) && child.type === 'html');
101
+ if (isRootLayout) {
102
+ // If this is the root layout, inject our provider after the body tag
103
+ return React__default.Children.map(children, child => {
104
+ if (React__default.isValidElement(child) && child.type === 'html') {
105
+ return React__default.cloneElement(child, {}, React__default.Children.map(child.props.children, bodyChild => {
106
+ if (React__default.isValidElement(bodyChild) && bodyChild.type === 'body') {
107
+ // Type assertion to access props safely
108
+ const bodyProps = bodyChild.props;
109
+ return React__default.cloneElement(bodyChild, {}, React__default.createElement(TernSecureClientProvider, null, bodyProps.children));
110
+ }
111
+ return bodyChild;
112
+ }));
113
+ }
114
+ return child;
115
+ });
116
+ }
117
+ // For non-root layouts, wrap normally
118
+ return React__default.createElement(TernSecureClientProvider, null, children);
119
+ }
120
+
121
+ function useAuth() {
122
+ const [state, setState] = useTernSecure('useAuth');
123
+ useEffect(() => {
124
+ try {
125
+ const auth = TernSecureAuth(); // This initializes Firebase
126
+ setState(prev => ({
127
+ ...prev,
128
+ firebase: {
129
+ initialized: true,
130
+ error: null
131
+ }
132
+ }));
133
+ const unsubscribe = auth.onAuthStateChanged((user) => {
134
+ setState(prev => ({
135
+ ...prev,
136
+ auth: {
137
+ user,
138
+ loading: false,
139
+ error: null,
140
+ isSignedIn: !!user
141
+ }
142
+ }));
143
+ }, (error) => {
144
+ setState(prev => ({
145
+ ...prev,
146
+ auth: {
147
+ user: null,
148
+ loading: false,
149
+ error,
150
+ isSignedIn: false
151
+ }
152
+ }));
153
+ });
154
+ return () => unsubscribe();
155
+ }
156
+ catch (error) {
157
+ setState(prev => ({
158
+ ...prev,
159
+ firebase: {
160
+ initialized: false,
161
+ error: error
162
+ },
163
+ auth: {
164
+ user: null,
165
+ loading: false,
166
+ error: error,
167
+ isSignedIn: false
168
+ }
169
+ }));
170
+ }
171
+ }, []); // Only run once on mount
172
+ return state.auth;
173
+ }
174
+
175
+ function SignIn({ onSuccess, onError, redirectUrl, className = '', customStyles = {} }) {
176
+ const [email, setEmail] = useState('');
177
+ const [password, setPassword] = useState('');
178
+ const [loading, setLoading] = useState(false);
179
+ const [error, setError] = useState('');
180
+ const handleSubmit = async (e) => {
181
+ e.preventDefault();
182
+ setLoading(true);
183
+ setError('');
184
+ try {
185
+ await signInWithEmail({ email, password });
186
+ onSuccess?.();
187
+ if (redirectUrl) {
188
+ window.location.href = redirectUrl;
189
+ }
190
+ }
191
+ catch (err) {
192
+ const errorMessage = err instanceof Error ? err.message : 'Failed to sign in';
193
+ setError(errorMessage);
194
+ onError?.(err instanceof Error ? err : new Error('Failed to sign in'));
195
+ }
196
+ finally {
197
+ setLoading(false);
198
+ }
199
+ };
200
+ const defaultStyles = {
201
+ form: 'space-y-4',
202
+ label: 'block text-sm font-medium text-gray-700',
203
+ input: 'mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary',
204
+ button: 'w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary disabled:opacity-50',
205
+ errorText: 'text-red-500 text-sm',
206
+ container: 'flex min-h-full flex-1 flex-col justify-center py-12 sm:px-6 lg:px-8'
207
+ };
208
+ const styles = {
209
+ form: customStyles.form || defaultStyles.form,
210
+ label: customStyles.label || defaultStyles.label,
211
+ container: customStyles.container || defaultStyles.container,
212
+ input: customStyles.input || defaultStyles.input,
213
+ button: customStyles.button || defaultStyles.button,
214
+ errorText: customStyles.errorText || defaultStyles.errorText
215
+ };
216
+ return (React.createElement("div", { className: styles.container },
217
+ React.createElement("div", { className: "sm:mx-auto sm:w-full sm:max-w-md" },
218
+ React.createElement("h2", { className: `mt-6 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900}` }, "Sign in to your account")),
219
+ React.createElement("div", { className: "mt-10 sm:mx-auto sm:w-full sm:max-w-[480px]" },
220
+ React.createElement("div", { className: "px-6 py-12 shadow sm:rounded-lg sm:px-12 " },
221
+ React.createElement("form", { onSubmit: handleSubmit, className: `${styles.form} ${className}`, role: "form", "aria-label": "Sign in form" },
222
+ error && (React.createElement("div", { className: styles.errorText, role: "alert", "aria-live": "polite" }, error)),
223
+ React.createElement("div", null,
224
+ React.createElement("label", { htmlFor: "email", className: styles.label }, "Email"),
225
+ React.createElement("input", { id: "email", type: "email", value: email, onChange: (e) => setEmail(e.target.value), placeholder: "Enter your email", required: true, className: styles.input, disabled: loading, "aria-required": "true", "aria-invalid": !!error })),
226
+ React.createElement("div", null,
227
+ React.createElement("label", { htmlFor: "password", className: styles.label }, "Password"),
228
+ React.createElement("input", { id: "password", type: "password", value: password, onChange: (e) => setPassword(e.target.value), placeholder: "Enter your password", required: true, className: styles.input, disabled: loading, "aria-required": "true", "aria-invalid": !!error })),
229
+ React.createElement("button", { type: "submit", disabled: loading, className: styles.button, "data-testid": "sign-in-submit" }, loading ? 'Signing in...' : 'Sign in'))))));
230
+ }
231
+
232
+ export { SignIn, TernSecureAuth, TernSecureFirestore, TernSecureProvider, TernSecureStorage, useAuth };
233
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EACH,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACpB,CAAC"}
1
+ {"version":3,"file":"index.js","sources":["../src/app-router/client/client-init.ts","../src/app-router/client/auth.ts","../src/app-router/client/config.ts","../src/app-router/client/providers/ternSecureContext.tsx","../src/app-router/client/providers/ternSecureClientProvider.tsx","../src/app-router/server/providers/TernSecureServerProvider.tsx","../src/hooks/useAuth.ts","../src/components/sign-in.tsx"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["TernSecureClientProvider","React"],"mappings":";;;;;;;;AAMA;AACA,MAAM,GAAG,GAAG,CAAC,MAAK;AAChB,IAAA,MAAM,MAAM,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC;AAC/C,IAAA,OAAO,OAAO,EAAE,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC;AAChE,CAAC,GAAG;AAEJ,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;AACzB,cAAc,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;AAChD,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC;MAElB,cAAc,GAAG,MAAM;MACvB,mBAAmB,GAAG,MAAM;MAC5B,iBAAiB,GAAG,MAAM;;ACXhC,eAAe,eAAe,CAAC,EACpC,KAAK,EACL,QAAQ,EACU,EAAA;AAClB,IAAA,MAAM,IAAI,GAAG,cAAc,EAAE;IAC7B,OAAO,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC1D;;ACZO,MAAM,cAAc,GAAG,OAAyB;AACrD,IAAA,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,4BAAsC;AAC1D,IAAA,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,gCAA0C;AAClE,IAAA,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,+BAAyC;AAChE,IAAA,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,mCAA6C;AACxE,IAAA,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,wCAAkD;AACjF,IAAA,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,2BAAqC;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EzC,EAAA,UAAA,CAAA;wBACR,KACE,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,EAAE,EAAC,UAAU,EACb,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,WAAW,EAAC,qBAAqB,EACjC,QAAQ,EAAA,IAAA,EACR,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,QAAQ,EAAE,OAAO,EACH,eAAA,EAAA,MAAM,kBACN,CAAC,CAAC,KAAK,EAAA,CACrB,CACE;AACN,oBAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EACZ,aAAA,EAAA,gBAAgB,EAE3B,EAAA,OAAO,GAAG,eAAe,GAAG,SAAS,CAC/B,CACJ,CACD,CACA,CACA;AAEV;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tern-secure/nextjs",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -16,7 +16,7 @@
16
16
  "main": "./dist/index.js",
17
17
  "module": "./dist/index.js",
18
18
  "scripts": {
19
- "build": "tsc --build",
19
+ "build": "rollup -c",
20
20
  "clean": "tsc --build --clean",
21
21
  "dev": "tsc --watch",
22
22
  "lint": "eslint \"src/**/*.{ts,tsx}\"",
@@ -97,6 +97,7 @@
97
97
  "types": "./dist/server/index.d.ts",
98
98
  "import": "./dist/server/index.js",
99
99
  "require": "./dist/server/index.js"
100
- }
100
+ },
101
+ "./styles": "./styles/index.css"
101
102
  }
102
103
  }