@bgord/bun 1.10.21 → 1.10.22
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/auth-session-reader-better-auth.adapter.d.ts +25 -4
- package/dist/auth-session-reader-better-auth.adapter.d.ts.map +1 -1
- package/dist/auth-session-reader-better-auth.adapter.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/auth-session-reader-better-auth.adapter.ts +2 -5
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Auth } from "better-auth";
|
|
2
2
|
import type { AuthSessionReaderPort } from "./auth-session-reader.port";
|
|
3
3
|
import type { HasRequestHeaders } from "./request-context.port";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export class AuthSessionReaderBetterAuthAdapter<TAuth extends BetterAuthInstance>
|
|
5
|
+
export class AuthSessionReaderBetterAuthAdapter<TAuth extends Auth<any>>
|
|
8
6
|
implements AuthSessionReaderPort<TAuth["$Infer"]["Session"]["user"], TAuth["$Infer"]["Session"]["session"]>
|
|
9
7
|
{
|
|
10
8
|
constructor(private readonly auth: TAuth) {}
|
|
@@ -13,7 +11,6 @@ export class AuthSessionReaderBetterAuthAdapter<TAuth extends BetterAuthInstance
|
|
|
13
11
|
const result = await this.auth.api.getSession({ headers: context.request.headers() });
|
|
14
12
|
|
|
15
13
|
if (!result) return { user: null, session: null };
|
|
16
|
-
|
|
17
14
|
return { user: result.user, session: result.session };
|
|
18
15
|
}
|
|
19
16
|
}
|