@tpzdsp/next-toolkit 1.9.4 → 1.9.5
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
|
@@ -7,8 +7,6 @@ type GoogleAnalyticsProps = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const GoogleAnalyticsComponent = ({ analyticsId }: GoogleAnalyticsProps) => {
|
|
10
|
-
console.log(`Google Analytics ID: ${analyticsId}`); // Debugging line to check the ID
|
|
11
|
-
|
|
12
10
|
return <Script src={`https://www.googletagmanager.com/gtag/js?id=${analyticsId}`} />;
|
|
13
11
|
};
|
|
14
12
|
|
package/src/utils/auth.ts
CHANGED
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
import { cookies } from 'next/headers';
|
|
4
4
|
import type { NextRequest } from 'next/server';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { getCookieName } from './constants';
|
|
7
7
|
import { decodeAuthToken } from './utils';
|
|
8
8
|
import type { Credentials } from '../types/auth';
|
|
9
9
|
|
|
10
|
-
export const getCredentials = async (
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export const getCredentials = async (
|
|
11
|
+
source?: NextRequest | null,
|
|
12
|
+
env?: string,
|
|
13
|
+
): Promise<Credentials | null> => {
|
|
14
|
+
if (!env) {
|
|
15
|
+
console.warn(
|
|
16
|
+
'getCredentials: No environment specified e.g. "live", using default cookie name "auth0-jwt-test". Pass the env parameter to use a different environment.',
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const cookieStore = source ? source.cookies : await cookies();
|
|
21
|
+
const token = cookieStore.get(getCookieName(env))?.value;
|
|
13
22
|
|
|
14
23
|
if (!token) {
|
|
15
24
|
return null;
|
package/src/utils/constants.ts
CHANGED