@authaz/next 1.0.7 → 1.0.8
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/index.js +4 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ const createAuthazHandler = (config) => {
|
|
|
95
95
|
};
|
|
96
96
|
const afterLoginUrl = config.afterLoginUrl || "/";
|
|
97
97
|
const afterLogoutUrl = config.afterLogoutUrl || "/";
|
|
98
|
-
|
|
98
|
+
config.authazDomain;
|
|
99
99
|
const authazIdentityDomain = config.authazIdentityDomain || "https://identity.authaz.io";
|
|
100
100
|
const fixedRedirectUri = config.redirectUri;
|
|
101
101
|
const isDebug = config.debug || false;
|
|
@@ -240,7 +240,8 @@ const createAuthazHandler = (config) => {
|
|
|
240
240
|
log("Getting current user");
|
|
241
241
|
const accessToken = (await getCookieStore()).get(COOKIE_NAMES.ACCESS_TOKEN)?.value;
|
|
242
242
|
if (!accessToken) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
243
|
-
|
|
243
|
+
logError("1 -- authazIdentityDomain", authazIdentityDomain);
|
|
244
|
+
const userinfo = await fetchUserinfo(authazIdentityDomain, accessToken, apiKey);
|
|
244
245
|
if (!userinfo) {
|
|
245
246
|
logError("Failed to fetch userinfo");
|
|
246
247
|
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
@@ -258,6 +259,7 @@ const createAuthazHandler = (config) => {
|
|
|
258
259
|
status: 401,
|
|
259
260
|
headers: { "WWW-Authenticate": "Bearer" }
|
|
260
261
|
});
|
|
262
|
+
logError("2 -- authazIdentityDomain", authazIdentityDomain);
|
|
261
263
|
const userinfo = await fetchUserinfo(authazIdentityDomain, accessToken, apiKey);
|
|
262
264
|
if (!userinfo) {
|
|
263
265
|
logError("Failed to fetch userinfo");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "@authaz",
|
|
3
3
|
"name": "@authaz/next",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "NextJS authaz SDK",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"next": ">=15",
|
|
41
41
|
"react": ">=17",
|
|
42
|
-
"@authaz/sdk": "^1.2.
|
|
42
|
+
"@authaz/sdk": "^1.2.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@jest/globals": "30.2.0",
|