@coreiam/auth 1.0.14 → 1.0.15

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.
@@ -4,7 +4,7 @@ export interface AuthResult {
4
4
  status: number;
5
5
  data: any;
6
6
  }
7
- export declare const getSession: () => Promise<CoreIAMIdentity | null>;
7
+ export declare function getSession(): Promise<CoreIAMIdentity | null>;
8
8
  export declare function loginActionSdk(identifier: string, password: string): Promise<AuthResult>;
9
9
  export declare function registerActionSdk(userData: any): Promise<AuthResult>;
10
10
  export declare function logoutActionSdk(): Promise<AuthResult>;
@@ -94,7 +94,7 @@
94
94
  // // src/nextjs/actions.ts
95
95
  // // REMOVE 'use server' from here.
96
96
  Object.defineProperty(exports, "__esModule", { value: true });
97
- exports.getSession = void 0;
97
+ exports.getSession = getSession;
98
98
  exports.loginActionSdk = loginActionSdk;
99
99
  exports.registerActionSdk = registerActionSdk;
100
100
  exports.logoutActionSdk = logoutActionSdk;
@@ -104,7 +104,6 @@ exports.verifyMfaActionSdk = verifyMfaActionSdk;
104
104
  exports.disableMfaActionSdk = disableMfaActionSdk;
105
105
  exports.requestOtpActionSdk = requestOtpActionSdk;
106
106
  exports.verifyOtpActionSdk = verifyOtpActionSdk;
107
- const react_1 = require("react");
108
107
  const headers_1 = require("next/headers");
109
108
  const core_1 = require("../core");
110
109
  // FIX: lazy singleton instead of `const iam = new CoreIAM();` at module
@@ -190,11 +189,7 @@ async function syncCookiesToNext(response) {
190
189
  // cookies. If middleware already refreshed upstream, this succeeds; if
191
190
  // middleware's refresh also failed, returning null here is correct, not a
192
191
  // bug to work around.
193
- exports.getSession = (0, react_1.cache)(async () => {
194
- // DEBUG_TRACE: temporary — remove once the duplicate-call question is
195
- // settled. This fires once per real (uncached) call, server-side, so it
196
- // shows up in the Next.js terminal, not the browser console. Grep
197
- // "DEBUG_TRACE" to find every line this touch added.
192
+ async function getSession() {
198
193
  console.log(`[DEBUG_TRACE] getSession() real fetch @ ${new Date().toISOString()}`);
199
194
  const reqHeaders = await (0, headers_1.headers)();
200
195
  const response = await getIam().proxy('/auth/profile', { method: 'GET' }, reqHeaders);
@@ -204,7 +199,7 @@ exports.getSession = (0, react_1.cache)(async () => {
204
199
  if (!coreIamIdentity?.sub)
205
200
  return null;
206
201
  return coreIamIdentity;
207
- });
202
+ }
208
203
  async function loginActionSdk(identifier, password) {
209
204
  const reqHeaders = await (0, headers_1.headers)();
210
205
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreiam/auth",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "main": "./dist/core/index.js",
5
5
  "types": "./dist/core/index.d.ts",
6
6
  "exports": {