@bananacool467/authtics-host 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,6 @@
1
1
  # Authtics Host
2
2
 
3
- Version 0.2.3
4
- License: MIT
3
+ Version 0.2.4, License: MIT
5
4
 
6
5
  Authtics Host is a web framework inspired by Next.js. Authtics Host supports SSR (Server-Side Rendering) and uses esbuild. This is not to be confused with auth platforms.
7
6
 
@@ -37,7 +36,7 @@ To make your app, with auto paging and auto filing, your file tree should look l
37
36
  index.tsx
38
37
  ```
39
38
 
40
- **(NOTE: the public folder is for auto filing)**
39
+ **(Note: the public folder is for auto filing)**
41
40
 
42
41
  `index.ts` should look like:
43
42
  ```ts
@@ -115,9 +114,9 @@ export default function App() {
115
114
  )
116
115
  }
117
116
  ```
118
- **(NOTE: You can change the `statusCode` to anything you want, the property is optional, it either gives 404 or 200 if the `statusCode` is missing.)**
117
+ **(Note: You can change the `statusCode` to anything you want, the property is optional, it either gives 404 or 200 if the `statusCode` is missing.)**
119
118
 
120
- **(NOTE: To make an 404 page you can use:**
119
+ **(Note: To make an 404 page you can use:**
121
120
  ```tsx
122
121
  <Route statusCode={404} page={NotFound} />
123
122
  ```
@@ -167,7 +166,7 @@ The Developer Panel is what you could use to help you debug your code. The Devel
167
166
 
168
167
  The information the Developer Panel shows outside of the tabs is just your **DAT** (Developer Access Token).
169
168
 
170
- **(NOTE: If you do not set DAT restriction (Which will be explained on how to set it up in the next section), you will only get access to the Console and Network tabs)**
169
+ **(Note: If you do not set DAT restriction (Which will be explained on how to set it up in the next section), you will only get access to the Console and Network tabs)**
171
170
 
172
171
  The Developer Panel also have remote buttons:
173
172
 
@@ -254,7 +253,7 @@ But if you have multiple DATs, then use:
254
253
 
255
254
  There isn't any limit of DATs you can add.
256
255
 
257
- **(NOTE: Adding your DAT will give you access to Restart and Shutdown and Pause/Resume Users and other features in the Developer Panel)**
256
+ **(Note: Adding your DAT will give you access to Restart and Shutdown and Pause/Resume Users and other features in the Developer Panel)**
258
257
 
259
258
  ## Reasons for the name, Authtics Host
260
259
 
package/dist/devPanel.js CHANGED
@@ -667,11 +667,7 @@ export default function DevPanel() {
667
667
  ;
668
668
  };
669
669
  try {
670
- let existingToken = null;
671
- try {
672
- existingToken = localStorage.getItem('dat');
673
- }
674
- catch (e) { }
670
+ const existingToken = cookie.get('dat');
675
671
  if (existingToken) {
676
672
  setToken(existingToken);
677
673
  let length_ = existingToken?.split('');
@@ -685,22 +681,12 @@ export default function DevPanel() {
685
681
  const serverDatRestricted = cfg?.datRestricted === true;
686
682
  if (serverDevMode && !serverDatRestricted) {
687
683
  const newToken = generateToken();
688
- try {
689
- let localStorageToken;
690
- try {
691
- localStorageToken = localStorage.getItem('dat');
692
- }
693
- catch (e) { }
694
- cookie.set('dat', localStorageToken || newToken);
695
- setToken(newToken);
696
- let length_ = newToken?.split('');
697
- let length;
698
- length = length_?.length;
699
- setTokenLength(length);
700
- }
701
- catch (error) {
702
- console.error('[Authtics Host] Error storing token in localStorage:', error);
703
- }
684
+ cookie.set('dat', newToken);
685
+ setToken(newToken);
686
+ let length_ = newToken?.split('');
687
+ let length;
688
+ length = length_?.length;
689
+ setTokenLength(length);
704
690
  }
705
691
  }
706
692
  }
@@ -1222,7 +1208,7 @@ export default function DevPanel() {
1222
1208
  gap: '6px',
1223
1209
  color: '#fff',
1224
1210
  flexDirection: 'row',
1225
- }, children: "Updates to security. Apps with version 0.0.1-beta.9 and over will now require DAT restriction to access remote features like restarting and shutting down the app." }) })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { restart(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: (datRestrictionMissing ? '#bdbdbd' : '#ba4e4e') }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Restart App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(Info, { size: 30 }), "Restarting the app is unavaliable. Set \"dat\" to your current DAT in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { shutDown(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: (datRestrictionMissing ? '#bdbdbd' : '#ba4e4e') }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Shut Down App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(Info, { size: 30 }), "Shutting down the app is unavaliable. Set \"dat\" to your current DAT in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { pause_Resume_Users(); }, fullWidth: true, style: { color: (datRestrictionMissing ? '#fff' : '#333'), justifyContent: 'center', height: '32px', background: (datRestrictionMissing ? '#bdbdbd' : '#f2f2f2') }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: usersPausedRealInfo ? "Resume Users" : "Pause Users" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(Info, { size: 30 }), "Pausing users from accessing the app is unavaliable. Set \"dat\" to your current DAT in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {}))] })] })) : (_jsx(_Fragment, {}))] }) }), datMatch ? (_jsxs("div", { onClick: () => setOpen(o => !o), style: {
1211
+ }, children: "Updates to security. Apps with version 0.0.1-beta.9 and over will now require DAT restriction to access remote features like restarting and shutting down the app." }) })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { restart(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: (datRestrictionMissing ? '#bdbdbd' : '#ba4e4e') }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Restart App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(Info, { size: 30 }), "Restarting the app is unavaliable. Set \"dat\" to your current DAT in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { shutDown(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: (datRestrictionMissing ? '#bdbdbd' : '#ba4e4e') }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: shuttingDown ? "Shutting Down App" : "Shut Down App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(Info, { size: 30 }), "Shutting down the app is unavaliable. Set \"dat\" to your current DAT in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { pause_Resume_Users(); }, fullWidth: true, style: { color: (datRestrictionMissing ? '#fff' : '#333'), justifyContent: 'center', height: '32px', background: (datRestrictionMissing ? '#bdbdbd' : '#f2f2f2') }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: usersPausedRealInfo ? "Resume Users" : "Pause Users" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(Info, { size: 30 }), "Pausing users from accessing the app is unavaliable. Set \"dat\" to your current DAT in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {}))] })] })) : (_jsx(_Fragment, {}))] }) }), datMatch ? (_jsxs("div", { onClick: () => setOpen(o => !o), style: {
1226
1212
  display: 'flex',
1227
1213
  flexDirection: 'row',
1228
1214
  alignItems: 'center',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananacool467/authtics-host",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Authtics Host, A Next.js-inspired SSR framework for Node.js with TypeScript and JSX support.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",