@secrecy/lib 1.43.0 → 1.45.0

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.
@@ -23,7 +23,7 @@ export const getUrl = ({ hash, path, }) => {
23
23
  const url = process.env.NEXT_PUBLIC_VERCEL_ENV &&
24
24
  process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production'
25
25
  ? `${process.env.NEXT_PUBLIC_VERCEL_URL}/${lang}/auth`
26
- : `auth.secrecy.tech/${lang}`;
26
+ : `www.secrecy.tech/${lang}/auth`;
27
27
  path = path.startsWith('/') ? path : `/${path}`;
28
28
  return `${protocol}://${url}${path}#${hash}`;
29
29
  };
@@ -14,7 +14,7 @@ export const getUrl = () => {
14
14
  const url = process.env.NEXT_PUBLIC_VERCEL_ENV &&
15
15
  process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production'
16
16
  ? `${process.env.NEXT_PUBLIC_VERCEL_URL}/api/trpc`
17
- : `api.secrecy.tech/trpc`;
17
+ : `www.secrecy.tech/api/trpc`;
18
18
  return `${protocol}://${url}`;
19
19
  };
20
20
  export const createTRPCClient = (session, onAccessDenied) => createTRPCProxyClient({
@@ -33,15 +33,17 @@ function withPath(origin, path) {
33
33
  }
34
34
  function getLocalLink({ app, path, }) {
35
35
  const sd = secrecyApplications.find((domain) => domain === app);
36
- return withPath(`http://localhost:3000/${sd ?? ''}`, path);
36
+ return withPath(`http://localhost:3000${sd ? `/${sd}` : ''}`, path);
37
37
  }
38
38
  function getPreviewLink({ app, path, }) {
39
39
  const sd = secrecyApplications.find((domain) => domain === app);
40
- return withPath(`https://${vercelUrl}/${sd ?? ''}`, path);
40
+ return withPath(`https://${vercelUrl}${sd ? `/${sd}` : ''}`, path);
41
41
  }
42
42
  function getProductionLink({ app, path, }) {
43
43
  const sd = secrecyApplications.find((domain) => domain === app);
44
- return withPath(`https://${sd ? `${sd}.` : ''}${vercelUrl}`, path);
44
+ // NOTE: We temporary using pathanem routing on production
45
+ // return withPath(`https://${sd ? `${sd}.` : ''}${vercelUrl}`, path)
46
+ return withPath(`https://${vercelUrl}${sd ? `/${sd}` : ''}`, path);
45
47
  }
46
48
  export const getLink = env === 'production'
47
49
  ? getProductionLink
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@secrecy/lib",
3
3
  "author": "Anonymize <anonymize@gmail.com>",
4
4
  "description": "Anonymize Secrecy Library",
5
- "version": "1.43.0",
5
+ "version": "1.45.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"