@secrecy/lib 1.47.0 → 1.47.1
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/lib/client/helpers.js +4 -1
- package/dist/lib/client.js +3 -0
- package/package.json +1 -1
|
@@ -19,13 +19,16 @@ export function parseInfos() {
|
|
|
19
19
|
}
|
|
20
20
|
export const getUrl = ({ hash, path, }) => {
|
|
21
21
|
const lang = document.documentElement.lang;
|
|
22
|
+
path = path.startsWith('/') ? path : `/${path}`;
|
|
23
|
+
if (process.env.NEXT_PUBLIC_SECRECY_URL) {
|
|
24
|
+
return `${process.env.NEXT_PUBLIC_SECRECY_URL}/${lang}/auth${path}#${hash}`;
|
|
25
|
+
}
|
|
22
26
|
const protocol = process.env.NEXT_PUBLIC_VERCEL_ENV !== 'development' ? 'https' : 'http';
|
|
23
27
|
const url = process.env.NEXT_PUBLIC_VERCEL_ENV &&
|
|
24
28
|
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production' &&
|
|
25
29
|
process.env.NEXT_PUBLIC_IS_SECRECY_INTERNAL === 'true'
|
|
26
30
|
? `${process.env.NEXT_PUBLIC_VERCEL_URL}/${lang}/auth`
|
|
27
31
|
: `www.secrecy.tech/${lang}/auth`;
|
|
28
|
-
path = path.startsWith('/') ? path : `/${path}`;
|
|
29
32
|
return `${protocol}://${url}${path}#${hash}`;
|
|
30
33
|
};
|
|
31
34
|
export function getSecrecyClient(session) {
|
package/dist/lib/client.js
CHANGED
|
@@ -10,6 +10,9 @@ superjson.registerCustom({
|
|
|
10
10
|
deserialize: (v) => Buffer.from(v),
|
|
11
11
|
}, 'buffer');
|
|
12
12
|
export const getUrl = () => {
|
|
13
|
+
if (process.env.NEXT_PUBLIC_SECRECY_URL) {
|
|
14
|
+
return process.env.NEXT_PUBLIC_SECRECY_URL;
|
|
15
|
+
}
|
|
13
16
|
const protocol = process.env.NEXT_PUBLIC_VERCEL_ENV !== 'development' ? 'https' : 'http';
|
|
14
17
|
const url = process.env.NEXT_PUBLIC_VERCEL_ENV &&
|
|
15
18
|
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production' &&
|
package/package.json
CHANGED