@kingironman2011/better-auth-bsky 0.2.2 → 0.2.3
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
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as atprotoPlaceholderEmail, r as fetchAtprotoProfilePublic, t as atproto } from "./server-
|
|
1
|
+
import { n as atprotoPlaceholderEmail, r as fetchAtprotoProfilePublic, t as atproto } from "./server-B4daPb_Y.js";
|
|
2
2
|
export { atproto, atprotoPlaceholderEmail, fetchAtprotoProfilePublic };
|
package/package.json
CHANGED
package/src/stores.ts
CHANGED
|
@@ -100,13 +100,15 @@ export class DbStateStore implements StateStore {
|
|
|
100
100
|
async get(stateKey: string): Promise<StoredState | undefined> {
|
|
101
101
|
const row = await this.adapter.findOne<{
|
|
102
102
|
stateData: string;
|
|
103
|
-
expiresAt: number;
|
|
103
|
+
expiresAt: Date | number;
|
|
104
104
|
}>({
|
|
105
105
|
model: "atprotoState",
|
|
106
106
|
where: [{ field: "stateKey", value: stateKey }],
|
|
107
107
|
});
|
|
108
108
|
if (!row) return undefined;
|
|
109
|
-
|
|
109
|
+
const expiresAtMs =
|
|
110
|
+
row.expiresAt instanceof Date ? row.expiresAt.getTime() : row.expiresAt;
|
|
111
|
+
if (expiresAtMs < Date.now()) {
|
|
110
112
|
// Expired — clean it up
|
|
111
113
|
await this.delete(stateKey);
|
|
112
114
|
return undefined;
|
|
@@ -122,7 +124,7 @@ export class DbStateStore implements StateStore {
|
|
|
122
124
|
data: {
|
|
123
125
|
stateKey,
|
|
124
126
|
stateData: data,
|
|
125
|
-
expiresAt: state.expiresAt,
|
|
127
|
+
expiresAt: new Date(state.expiresAt),
|
|
126
128
|
},
|
|
127
129
|
});
|
|
128
130
|
}
|