phibelle-kit 1.0.13 → 1.0.14
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/lib/conf.js +5 -3
- package/dist/lib/convex-client.js +1 -1
- package/package.json +1 -1
package/dist/lib/conf.js
CHANGED
|
@@ -3,14 +3,16 @@ import Conf from "conf";
|
|
|
3
3
|
const CONFIG = new Conf({
|
|
4
4
|
projectName: "phibelle-kit",
|
|
5
5
|
});
|
|
6
|
+
/** Auth token kept in memory only (session); never persisted for security. */
|
|
7
|
+
let sessionToken;
|
|
6
8
|
export function setToken(token) {
|
|
7
|
-
|
|
9
|
+
sessionToken = token;
|
|
8
10
|
}
|
|
9
11
|
export function getStoredToken() {
|
|
10
|
-
return
|
|
12
|
+
return sessionToken;
|
|
11
13
|
}
|
|
12
14
|
export function clearToken() {
|
|
13
|
-
|
|
15
|
+
sessionToken = undefined;
|
|
14
16
|
}
|
|
15
17
|
/** Stable session ID for this CLI instance; used so we can skip re-unpack when we were the ones who saved. */
|
|
16
18
|
export function getSessionId() {
|
|
@@ -8,7 +8,7 @@ if (!CONVEX_URL) {
|
|
|
8
8
|
export function createConvexClient() {
|
|
9
9
|
const token = getStoredToken();
|
|
10
10
|
if (!token) {
|
|
11
|
-
throw new Error("Not authenticated.
|
|
11
|
+
throw new Error("Not authenticated. Run your command again and complete the browser sign-in when prompted.");
|
|
12
12
|
}
|
|
13
13
|
const client = new ConvexClient(CONVEX_URL);
|
|
14
14
|
client.setAuth(() => Promise.resolve(token));
|