@snokam/auth 2.2.17-alpha.2 → 2.2.18
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/CHANGELOG.md +14 -1
- package/lib/middleware.js +1 -1
- package/lib/middleware.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [2.2.
|
|
6
|
+
## [2.2.18](https://github.com/snokam/components/compare/@snokam/auth@2.2.17...@snokam/auth@2.2.18) (2025-09-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* force new version ([829e22d](https://github.com/snokam/components/commit/829e22d57f4da1031309bbdc4ad3bf1f1d385d19))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.2.17](https://github.com/snokam/components/compare/@snokam/auth@2.2.17-alpha.1...@snokam/auth@2.2.17) (2025-09-25)
|
|
7
18
|
|
|
8
19
|
|
|
9
20
|
### Bug Fixes
|
|
10
21
|
|
|
11
22
|
* force new version ([712f5bb](https://github.com/snokam/components/commit/712f5bbe019991ce5803e9a8ed7fc80d47e225b4))
|
|
23
|
+
* regex pattern ([1619711](https://github.com/snokam/components/commit/1619711707acbcac040603adb9047e88c6eb0ee7))
|
|
24
|
+
* support regex ([5e7d211](https://github.com/snokam/components/commit/5e7d211afde701a299ec8a44e550e6070ac3b46d))
|
|
12
25
|
|
|
13
26
|
|
|
14
27
|
|
package/lib/middleware.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{buildAuthMiddleware:()=>i,config:()=>c,default:()=>l});const n=require("path-to-regexp"),o=require("next-auth/middleware");var r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const a=["/((?!api/healthy|api/ready|_next/static|_next/image|favicon.ico|.*\\..*).*)"];function i(e={}){var t,{matcher:i=[],callbacks:s={},protectAllRoutes:c}=e,l=r(e,["matcher","callbacks","protectAllRoutes"]);const u="preview"===process.env.NEXT_PUBLIC_VERCEL_ENV,{name:d}=function(e){const{hostname:t,protocol:n}=new URL(e),o="https:"===n,r=o?"__Secure-":"",{tag:a,domain:i}=(()=>{if("localhost"===t||/^[\d.]+$/.test(t))return{tag:"local"};if(t.endsWith(".test.snokam.no"))return{tag:"test",domain:".test.snokam.no"};if(t.endsWith(".snokam.no"))return{tag:"prod",domain:".snokam.no"};const e=t.split(".");if(e.length>=2){const t=e.slice(-2).join(".");return{tag:t.replace(/\./g,"-"),domain:`.${t}`}}return{tag:"host"}})();return{name:`${r}next-auth.${a}.session-token`,domain:i,secure:o}}(`${process.env.NEXTAUTH_URL}`);return{middleware:(0,o.withAuth)((e=>{}),Object.assign({pages:{signIn:"/auth/login"},cookies:{sessionToken:{name:d}},callbacks:{authorized:null!==(t=s.authorized)&&void 0!==t?t:({req:e,token:t})=>{return o=e.nextUrl.pathname,!(u||c&&0===(null==i?void 0:i.length)||i.some((e=>{if(!e)return!1;if(e.startsWith("/
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{buildAuthMiddleware:()=>i,config:()=>c,default:()=>l});const n=require("path-to-regexp"),o=require("next-auth/middleware");var r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const a=["/((?!api/healthy|api/ready|_next/static|_next/image|favicon.ico|.*\\..*).*)"];function i(e={}){var t,{matcher:i=[],callbacks:s={},protectAllRoutes:c}=e,l=r(e,["matcher","callbacks","protectAllRoutes"]);const u="preview"===process.env.NEXT_PUBLIC_VERCEL_ENV,{name:d}=function(e){const{hostname:t,protocol:n}=new URL(e),o="https:"===n,r=o?"__Secure-":"",{tag:a,domain:i}=(()=>{if("localhost"===t||/^[\d.]+$/.test(t))return{tag:"local"};if(t.endsWith(".test.snokam.no"))return{tag:"test",domain:".test.snokam.no"};if(t.endsWith(".snokam.no"))return{tag:"prod",domain:".snokam.no"};const e=t.split(".");if(e.length>=2){const t=e.slice(-2).join(".");return{tag:t.replace(/\./g,"-"),domain:`.${t}`}}return{tag:"host"}})();return{name:`${r}next-auth.${a}.session-token`,domain:i,secure:o}}(`${process.env.NEXTAUTH_URL}`);return{middleware:(0,o.withAuth)((e=>{}),Object.assign({pages:{signIn:"/auth/login"},cookies:{sessionToken:{name:d}},callbacks:{authorized:null!==(t=s.authorized)&&void 0!==t?t:({req:e,token:t})=>{return o=e.nextUrl.pathname,!(u||c&&0===(null==i?void 0:i.length)||i.some((e=>{if(!e)return!1;if(e.startsWith("/")&&e.endsWith(")"))return new RegExp(e).test(o);if(e.endsWith(":path*")){const t=e.replace(/\/:path\*$/,"");return o.startsWith(t)}try{return!1!==(0,n.match)(e,{end:!0})(o)}catch(e){return console.warn(`Invalid path pattern in auth middleware: ${e}`),!1}})))||!!t;var o}}},l)),config:u?{matcher:a}:(null==i?void 0:i.length)>0?{matcher:i}:void 0}}const{middleware:s,config:c}=i(),l=s;return t})()));
|
|
2
2
|
//# sourceMappingURL=middleware.js.map
|
package/lib/middleware.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,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AAQC,IAAIqB,gBA6CzD,MAAO,CAAEC,YAhBU,IAAAC,WAAUC,IAAD,GAAezD,OAAO0D,OAAO,CAAEC,MAAO,CAC1DC,OAAQ,eACTC,QAAS,CACRC,aAAc,CACV3B,SAELP,UAAW,CACVmC,WAA4C,QAA/BrC,EAAKE,EAAUmC,kBAA+B,IAAPrC,EAAgBA,EAAK,EAAIsC,MAAKC,YAC9E,OApCeC,EAoCUF,EAAIG,QAAQD,WAnCzCnC,GAAcF,GAA2F,KAAtEF,aAAyC,EAASA,EAAQN,SAG1FM,EAAQyC,MAAMC,IACjB,IAAKA,EACD,OAAO,EAGX,GAAIA,EAAQC,WAAW,MAAQD,EAAQxB,SAAS,KAE5C,OADc,IAAI0B,OAAOF,GACZzB,KAAKsB,GAGtB,GAAIG,EAAQxB,SAAS,UAAW,CAC5B,MAAMG,EAAOqB,EAAQlB,QAAQ,aAAc,IAC3C,OAAOe,EAASI,WAAWtB,EAC/B,CAEA,IACI,OAAmD,KAA5C,IAAAwB,OAAMH,EAAS,CAAEI,KAAK,GAAtB,CAA8BP,EACzC,CACA,MAAOQ,GAEH,OADAC,QAAQC,KAAK,4CAA4CF,MAClD,CACX,SAWuDT,EApCrC,IAACC,CAqClB,IACApC,IAMY+C,OALN9C,EACT,CAAEJ,QAASJ,IACVI,aAAyC,EAASA,EAAQN,QAAU,EACjE,CAAEM,gBACFmD,EAEd,CAEA,MAAM,WAAEvB,EAAU,OAAEsB,GAAWrD,IAE/B,I","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"path-to-regexp\"","webpack://snokam/external commonjs \"next-auth/middleware\"","webpack://snokam/./src/middleware.tsx","webpack://snokam/./src/utils/cookies.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"path-to-regexp\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next-auth/middleware\");","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { match } from \"path-to-regexp\";\nimport { withAuth } from \"next-auth/middleware\";\nimport { getSessionCookieSettings } from \"./utils/cookies\";\n// Default catch-all matcher used in Vercel preview environments\nconst previewMatcher = [\n \"/((?!api/healthy|api/ready|_next/static|_next/image|favicon.ico|.*\\\\..*).*)\",\n];\nexport function buildAuthMiddleware(_a = {}) {\n var _b;\n var { matcher = [], callbacks = {}, protectAllRoutes } = _a, rest = __rest(_a, [\"matcher\", \"callbacks\", \"protectAllRoutes\"]);\n const isPreview = process.env.NEXT_PUBLIC_VERCEL_ENV === \"preview\";\n const { name } = getSessionCookieSettings(`${process.env.NEXTAUTH_URL}`);\n const shouldProtectPath = (pathname) => {\n if (isPreview || (protectAllRoutes && (matcher === null || matcher === void 0 ? void 0 : matcher.length) === 0)) {\n return true;\n }\n return matcher.some((pattern) => {\n if (!pattern) {\n return false;\n }\n // Handle regex patterns (starting with / and containing complex regex)\n if (pattern.startsWith(\"/\") && pattern.endsWith(\")\")) {\n const regex = new RegExp(pattern);\n return regex.test(pathname);\n }\n // Handle simple path patterns with :path*\n if (pattern.endsWith(\":path*\")) {\n const base = pattern.replace(/\\/:path\\*$/, \"\");\n return pathname.startsWith(base);\n }\n // Handle path-to-regexp patterns (fallback)\n try {\n return match(pattern, { end: true })(pathname) !== false;\n }\n catch (error) {\n console.warn(`Invalid path pattern in auth middleware: ${error}`);\n return false;\n }\n });\n };\n const middleware = withAuth((_req) => { }, Object.assign({ pages: {\n signIn: \"/auth/login\",\n }, cookies: {\n sessionToken: {\n name,\n },\n }, callbacks: {\n authorized: (_b = callbacks.authorized) !== null && _b !== void 0 ? _b : (({ req, token }) => {\n return shouldProtectPath(req.nextUrl.pathname) ? !!token : true;\n }),\n } }, rest));\n const config = isPreview\n ? { matcher: previewMatcher }\n : (matcher === null || matcher === void 0 ? void 0 : matcher.length) > 0\n ? { matcher }\n : undefined;\n return { middleware, config };\n}\n// Default: protect all HTML pages in preview, do nothing in production\nconst { middleware, config } = buildAuthMiddleware();\nexport { config };\nexport default middleware;\n","export function getSessionCookieSettings(nextAuthUrl) {\n const { hostname, protocol } = new URL(nextAuthUrl);\n const secure = protocol === \"https:\";\n const prefix = secure ? \"__Secure-\" : \"\";\n const getTagAndDomain = () => {\n if (hostname === \"localhost\" || /^[\\d.]+$/.test(hostname)) {\n return { tag: \"local\" };\n }\n if (hostname.endsWith(\".test.snokam.no\")) {\n return { tag: \"test\", domain: \".test.snokam.no\" };\n }\n if (hostname.endsWith(\".snokam.no\")) {\n return { tag: \"prod\", domain: \".snokam.no\" };\n }\n const parts = hostname.split(\".\");\n if (parts.length >= 2) {\n const base = parts.slice(-2).join(\".\");\n return { tag: base.replace(/\\./g, \"-\"), domain: `.${base}` };\n }\n return { tag: \"host\" };\n };\n const { tag, domain } = getTagAndDomain();\n const name = `${prefix}next-auth.${tag}.session-token`;\n return { name, domain, secure };\n}\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","__rest","s","e","t","p","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","previewMatcher","buildAuthMiddleware","_a","_b","matcher","callbacks","protectAllRoutes","rest","isPreview","process","env","NEXT_PUBLIC_VERCEL_ENV","name","nextAuthUrl","hostname","protocol","URL","secure","prefix","tag","domain","test","endsWith","parts","split","base","slice","join","replace","getTagAndDomain","getSessionCookieSettings","NEXTAUTH_URL","middleware","withAuth","_req","assign","pages","signIn","cookies","sessionToken","authorized","req","token","pathname","nextUrl","some","pattern","startsWith","RegExp","match","end","error","console","warn","config","undefined"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snokam/auth",
|
|
3
3
|
"description": "Snøkam auth components",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.18",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "573dcccb18546ffce03cfd4215de26214afb5a93"
|
|
71
71
|
}
|