@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/bun",
3
- "version": "1.10.21",
3
+ "version": "1.10.22",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -1,10 +1,8 @@
1
- import type { betterAuth } from "better-auth";
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
- type BetterAuthInstance = ReturnType<typeof betterAuth>;
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
  }