@bananacool467/authtics-host 0.2.2 → 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 +6 -7
- package/dist/devPanel.js +9 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Authtics Host
|
|
2
2
|
|
|
3
|
-
Version 0.2.
|
|
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
|
-
**(
|
|
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
|
-
**(
|
|
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
|
-
**(
|
|
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
|
-
**(
|
|
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
|
-
**(
|
|
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
|
@@ -651,14 +651,14 @@ export default function DevPanel() {
|
|
|
651
651
|
}, []);
|
|
652
652
|
useEffect(() => {
|
|
653
653
|
installConsoleInterceptor();
|
|
654
|
-
installNetworkInterceptor((f) => setNetworkFetches(prev => [...prev.slice(-
|
|
654
|
+
installNetworkInterceptor((f) => setNetworkFetches(prev => [...prev.slice(-499), f]), (f) => setNetworkFetches(prev => prev.map(p => p.id === f.id ? f : p)), (f) => setEventSources(prev => [...prev.slice(-499), f]), (f) => setEventSources(prev => prev.map(p => p.id === f.id ? f : p)), (f) => setWebSockets(prev => [...prev.slice(-499), f]), (f) => setWebSockets(prev => prev.map(p => p.id === f.id ? f : p)), (f) => setResourcesFound(prev => [...prev.slice(-499), f]), (f) => setResourcesFound(prev => prev.map(p => p.id === f.id ? f : p)), (f) => setResourcesFound(prev => prev.filter(p => p.id !== f.id)), (sent) => {
|
|
655
655
|
pendingSent.current += sent;
|
|
656
656
|
}, (received) => {
|
|
657
657
|
pendingReceived.current += received;
|
|
658
658
|
});
|
|
659
659
|
const handler = (e) => {
|
|
660
660
|
const detail = e.detail;
|
|
661
|
-
setLogs(prev => [...prev.slice(-
|
|
661
|
+
setLogs(prev => [...prev.slice(-19999), { ...detail, id: Date.now() + Math.random() }]);
|
|
662
662
|
if (detail.type === 'Error') {
|
|
663
663
|
setHasIssue(true);
|
|
664
664
|
setErrorMsgs(prev => [...prev, detail.message]);
|
|
@@ -681,22 +681,12 @@ export default function DevPanel() {
|
|
|
681
681
|
const serverDatRestricted = cfg?.datRestricted === true;
|
|
682
682
|
if (serverDevMode && !serverDatRestricted) {
|
|
683
683
|
const newToken = generateToken();
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
cookie.set('dat', localStorageToken || newToken);
|
|
691
|
-
setToken(newToken);
|
|
692
|
-
let length_ = newToken?.split('');
|
|
693
|
-
let length;
|
|
694
|
-
length = length_?.length;
|
|
695
|
-
setTokenLength(length);
|
|
696
|
-
}
|
|
697
|
-
catch (error) {
|
|
698
|
-
console.error('[Authtics Host] Error storing token in localStorage:', error);
|
|
699
|
-
}
|
|
684
|
+
cookie.set('dat', newToken);
|
|
685
|
+
setToken(newToken);
|
|
686
|
+
let length_ = newToken?.split('');
|
|
687
|
+
let length;
|
|
688
|
+
length = length_?.length;
|
|
689
|
+
setTokenLength(length);
|
|
700
690
|
}
|
|
701
691
|
}
|
|
702
692
|
}
|
|
@@ -1218,7 +1208,7 @@ export default function DevPanel() {
|
|
|
1218
1208
|
gap: '6px',
|
|
1219
1209
|
color: '#fff',
|
|
1220
1210
|
flexDirection: 'row',
|
|
1221
|
-
}, 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: {
|
|
1222
1212
|
display: 'flex',
|
|
1223
1213
|
flexDirection: 'row',
|
|
1224
1214
|
alignItems: 'center',
|
package/package.json
CHANGED