@deslop/auth 0.1.1291 → 0.1.1295
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/server.js +8 -8
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -91982,7 +91982,7 @@ const decodeUnverified = /*#__PURE__*/ fnUntraced(function* (token) {
|
|
|
91982
91982
|
});
|
|
91983
91983
|
// ../../packages/runtime/src/auth/sessions.ts
|
|
91984
91984
|
const Stored = Struct({
|
|
91985
|
-
access: NonEmptyString,
|
|
91985
|
+
access: RedactedFromValue(NonEmptyString),
|
|
91986
91986
|
clientId: NonEmptyString,
|
|
91987
91987
|
createdAt: Finite,
|
|
91988
91988
|
expiresAt: Finite,
|
|
@@ -92033,7 +92033,7 @@ var Sessions = class Sessions extends Service$1()("@deslop/runtime/auth/sessions
|
|
|
92033
92033
|
const claims = yield* decodeUnknownEffect(AccessClaims)((yield* decodeUnverified(tokens.access_token)).claims);
|
|
92034
92034
|
const now = yield* currentTimeMillis;
|
|
92035
92035
|
return Stored.make({
|
|
92036
|
-
access: tokens.access_token,
|
|
92036
|
+
access: make$63(tokens.access_token),
|
|
92037
92037
|
clientId,
|
|
92038
92038
|
createdAt,
|
|
92039
92039
|
expiresAt: now + tokens.expires_in * 1e3,
|
|
@@ -92065,14 +92065,14 @@ var Sessions = class Sessions extends Service$1()("@deslop/runtime/auth/sessions
|
|
|
92065
92065
|
value
|
|
92066
92066
|
}))), { concurrency: "unbounded" });
|
|
92067
92067
|
for (const session of matchingSessions(saved, userId)) {
|
|
92068
|
-
if (yield* fresh(session.value)) return session.value.access;
|
|
92068
|
+
if (yield* fresh(session.value)) return value$2(session.value.access);
|
|
92069
92069
|
const renewed = yield* result$1(pipe(refreshed(session.key), rejected("AI access is temporarily unavailable")));
|
|
92070
|
-
if (renewed._tag === "Success") return renewed.success.access;
|
|
92070
|
+
if (renewed._tag === "Success") return value$2(renewed.success.access);
|
|
92071
92071
|
if (is$2(AuthError)(renewed.failure) && renewed.failure.error === "temporarily_unavailable") return yield* renewed.failure;
|
|
92072
92072
|
}
|
|
92073
92073
|
const now = yield* currentTimeMillis;
|
|
92074
92074
|
const bearer = getOrUndefined$1(filter$8(get$11(bearers, userId), (access) => access.expiresAt >= now + 6e4));
|
|
92075
|
-
if (bearer !== void 0) return bearer.token;
|
|
92075
|
+
if (bearer !== void 0) return value$2(bearer.token);
|
|
92076
92076
|
remove$5(bearers, userId);
|
|
92077
92077
|
return yield* AuthError.make({ message: `Open ${capitalize(split$2(new URL(app).hostname, ".")[0])} once so it can use AI for you` });
|
|
92078
92078
|
}, rejected("AI access is temporarily unavailable"));
|
|
@@ -92081,12 +92081,12 @@ var Sessions = class Sessions extends Service$1()("@deslop/runtime/auth/sessions
|
|
|
92081
92081
|
const key = yield* keyOf(id);
|
|
92082
92082
|
const saved = yield* fromOption(yield* store.get(key));
|
|
92083
92083
|
if (yield* fresh(saved)) return {
|
|
92084
|
-
token: saved.access,
|
|
92084
|
+
token: value$2(saved.access),
|
|
92085
92085
|
user: saved.user
|
|
92086
92086
|
};
|
|
92087
92087
|
const renewed = yield* refreshed(key);
|
|
92088
92088
|
return {
|
|
92089
|
-
token: renewed.access,
|
|
92089
|
+
token: value$2(renewed.access),
|
|
92090
92090
|
user: renewed.user
|
|
92091
92091
|
};
|
|
92092
92092
|
}, rejected("Sign in first")),
|
|
@@ -92106,7 +92106,7 @@ var Sessions = class Sessions extends Service$1()("@deslop/runtime/auth/sessions
|
|
|
92106
92106
|
remember: (token, claims) => sync(() => {
|
|
92107
92107
|
set$5(bearers, claims.sub, {
|
|
92108
92108
|
expiresAt: claims.exp * 1e3,
|
|
92109
|
-
token
|
|
92109
|
+
token: make$63(token)
|
|
92110
92110
|
});
|
|
92111
92111
|
}),
|
|
92112
92112
|
start: fn("Sessions.start")(function* (grant) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1295",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/MP281X/deslop.git",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=26"
|
|
35
35
|
},
|
|
36
|
-
"fingerprint": "
|
|
36
|
+
"fingerprint": "89ef823add14f0d17f7af584110c04bf4739d954fa31cf77728000bc8a71967b"
|
|
37
37
|
}
|