@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.
package/dist/nextjs/actions.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface AuthResult {
|
|
|
4
4
|
status: number;
|
|
5
5
|
data: any;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
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>;
|
package/dist/nextjs/actions.js
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
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 {
|