@snokam/auth 2.0.54-alpha.0 → 2.0.55

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 CHANGED
@@ -3,6 +3,28 @@
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.0.55](https://github.com/snokam/components/compare/@snokam/auth@2.0.54...@snokam/auth@2.0.55) (2025-02-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * remove page loader on sso login ([7f8118b](https://github.com/snokam/components/commit/7f8118bc22badedc4ed64646cf938b56427580bd))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.0.54](https://github.com/snokam/components/compare/@snokam/auth@2.0.53...@snokam/auth@2.0.54) (2025-02-17)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * do ssoSilent ([5b22656](https://github.com/snokam/components/commit/5b226567d7990ab3542f9cc5eca35486b454f466))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [2.0.53](https://github.com/snokam/components/compare/@snokam/auth@2.0.52...@snokam/auth@2.0.53) (2025-02-17)
7
29
 
8
30
  **Note:** Version bump only for package @snokam/auth
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
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={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},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,{Authenticated:()=>r.AuthenticatedTemplate,Unauthenticated:()=>r.UnauthenticatedTemplate,default:()=>y,useAuth:()=>d});const n=require("react/jsx-runtime"),r=require("@azure/msal-react"),o=require("@azure/msal-browser"),i=require("next/compat/router"),s=require("react"),a="redirect",c=()=>{window.sessionStorage.setItem(a,window.location.pathname)},l=require("@snokam/core"),u=require("@mui/material"),d=()=>{const{instance:e,inProgress:t}=(0,r.useMsal)(),n=e.getAllAccounts()[0];return{getToken:t=>e.acquireTokenSilent({scopes:t||[],account:n}).then((({accessToken:e})=>`Bearer ${e}`)),isAuthenticated:(0,r.useIsAuthenticated)(),inProgress:"startup"===t||"login"===t,instance:e,account:n}},g={scopes:["openid"]},p=require("@emotion/styled");var m=e.n(p);const f={Container:m().div`
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={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},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,{Authenticated:()=>r.AuthenticatedTemplate,Unauthenticated:()=>r.UnauthenticatedTemplate,default:()=>y,useAuth:()=>d});const n=require("react/jsx-runtime"),r=require("@azure/msal-react"),o=require("@azure/msal-browser"),i=require("next/compat/router"),s=require("react"),c="redirect",a=()=>{window.sessionStorage.setItem(c,window.location.pathname)},l=require("@snokam/core"),u=require("@mui/material"),d=()=>{const{instance:e,inProgress:t}=(0,r.useMsal)(),n=e.getAllAccounts()[0];return{getToken:t=>e.acquireTokenSilent({scopes:t||[],account:n}).then((({accessToken:e})=>`Bearer ${e}`)),isAuthenticated:(0,r.useIsAuthenticated)(),inProgress:"startup"===t||"login"===t,instance:e,account:n}},g={scopes:["openid"]},p=require("@emotion/styled");var m=e.n(p);const h={Container:m().div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  justify-content: center;
@@ -6,5 +6,5 @@
6
6
  flex: 1;
7
7
  `,Link:m().a`
8
8
  text-decoration: "underline";
9
- `},h=()=>{const{instance:e}=(0,r.useMsal)(),{account:t}=d(),[o,i]=(0,s.useState)();return o?(0,n.jsxs)(f.Container,{children:[(0,n.jsxs)("p",{children:["En feil oppstod: ",o.errorCode]}),(0,n.jsxs)("span",{children:["Prøv å gå direkte til ",(0,n.jsx)(f.Link,{target:"_blank",href:"https://skjer.snokam.no/?enforceLogin=true",rel:"noopener noreferrer",children:"skjer.snokam.no"}),"."]})]}):(0,n.jsxs)(f.Container,{children:["Du må logge inn på nytt for å vise siden",(0,n.jsx)(u.Button,{sx:{marginTop:"1rem"},onClick:()=>{c(),e.loginPopup(Object.assign(Object.assign(Object.assign({},g),t&&{account:t}),{redirectUri:"/blank.html"})).then((()=>i(void 0))).catch((e=>i(e)))},children:"Fortsett"})]})},j=e=>{const{children:t}=e,{query:s}=(0,i.useRouter)(),a=s.username,u=(null==s?void 0:s.enforceLogin)&&(null==s?void 0:s.username)?o.InteractionType.Silent:o.InteractionType.Redirect,d=Object.assign(Object.assign(Object.assign({},g),a&&{loginHint:a}),{onRedirectNavigate:e=>{c()}});return(0,n.jsx)(r.MsalAuthenticationTemplate,{interactionType:u,authenticationRequest:d,errorComponent:h,loadingComponent:()=>(0,n.jsx)(l.PageLoader,{}),children:t})},b=e=>{const{children:t,enforceLogin:a}=e,[c,u]=(0,s.useState)(!0),{query:d}=(0,i.useRouter)(),p=(0,s.useRef)(null),m=d.username;if(!p.current){const t={auth:{instanceAware:!0,clientId:e.config.clientId,authority:`https://login.microsoftonline.com/${e.config.tenantId}/`,postLogoutRedirectUri:"/",redirectUri:"/callback",navigateToLoginRequestUrl:!1},system:{allowRedirectInIframe:!0},cache:{cacheLocation:"localStorage"}};p.current=new o.PublicClientApplication(t),p.current.initialize().then((()=>{f.ssoSilent(Object.assign(Object.assign({},g),m&&{loginHint:m})).catch((()=>{})).finally((()=>{u(!1)}))}))}const f=p.current;return c?(0,n.jsx)(l.PageLoader,{}):d.enforceLogin||a?(0,n.jsx)(r.MsalProvider,{instance:f,children:(0,n.jsx)(j,Object.assign({},e,{children:t}))}):(0,n.jsx)(r.MsalProvider,{instance:f,children:t})};b.Callback=()=>{const e=(0,i.useRouter)();return(0,s.useEffect)((()=>{const t=window.sessionStorage.getItem(a);t?(window.sessionStorage.removeItem(a),console.log(`Redirecting to ${t} ...`),e.replace(t)):e.replace("/")}),[e]),(0,n.jsx)(l.PageLoader,{})};const y={Provider:b,Authenticate:j};return t})()));
9
+ `},f=()=>{const{instance:e}=(0,r.useMsal)(),{account:t}=d(),[o,i]=(0,s.useState)();return o?(0,n.jsxs)(h.Container,{children:[(0,n.jsxs)("p",{children:["En feil oppstod: ",o.errorCode]}),(0,n.jsxs)("span",{children:["Prøv å gå direkte til ",(0,n.jsx)(h.Link,{target:"_blank",href:"https://skjer.snokam.no/?enforceLogin=true",rel:"noopener noreferrer",children:"skjer.snokam.no"}),"."]})]}):(0,n.jsxs)(h.Container,{children:["Du må logge inn på nytt for å vise siden",(0,n.jsx)(u.Button,{sx:{marginTop:"1rem"},onClick:()=>{a(),e.loginPopup(Object.assign(Object.assign(Object.assign({},g),t&&{account:t}),{redirectUri:"/blank.html"})).then((()=>i(void 0))).catch((e=>i(e)))},children:"Fortsett"})]})},j=e=>{const{children:t}=e,{query:s}=(0,i.useRouter)(),c=s.username,u=(null==s?void 0:s.enforceLogin)&&(null==s?void 0:s.username)?o.InteractionType.Silent:o.InteractionType.Redirect,d=Object.assign(Object.assign(Object.assign({},g),c&&{loginHint:c}),{onRedirectNavigate:e=>{a()}});return(0,n.jsx)(r.MsalAuthenticationTemplate,{interactionType:u,authenticationRequest:d,errorComponent:f,loadingComponent:()=>(0,n.jsx)(l.PageLoader,{}),children:t})},b=e=>{const{children:t,enforceLogin:c}=e,{query:a}=(0,i.useRouter)(),l=(0,s.useRef)(null),u=a.username;if(!l.current){const t={auth:{instanceAware:!0,clientId:e.config.clientId,authority:`https://login.microsoftonline.com/${e.config.tenantId}/`,postLogoutRedirectUri:"/",redirectUri:"/callback",navigateToLoginRequestUrl:!1},system:{allowRedirectInIframe:!0},cache:{cacheLocation:"localStorage"}};l.current=new o.PublicClientApplication(t),l.current.initialize().then((()=>{d.ssoSilent(Object.assign(Object.assign({},g),u&&{loginHint:u})).catch((()=>{}))}))}const d=l.current;return a.enforceLogin||c?(0,n.jsx)(r.MsalProvider,{instance:d,children:(0,n.jsx)(j,Object.assign({},e,{children:t}))}):(0,n.jsx)(r.MsalProvider,{instance:d,children:t})};b.Callback=()=>{const e=(0,i.useRouter)();return(0,s.useEffect)((()=>{const t=window.sessionStorage.getItem(c);t?(window.sessionStorage.removeItem(c),console.log(`Redirecting to ${t} ...`),e.replace(t)):e.replace("/")}),[e]),(0,n.jsx)(l.PageLoader,{})};const y={Provider:b,Authenticate:j};return t})()));
10
10
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.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,EAAyBJ,IACxB,IAAIK,EAASL,GAAUA,EAAOM,WAC7B,IAAON,EAAiB,QACxB,IAAM,EAEP,OADAI,EAAoBG,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdD,EAAwB,CAACL,EAASU,KACjC,IAAI,IA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CACFC,eAAe,EACfC,SAAU3B,EAAMwB,OAAOG,SACvBC,UAAW,qCAAqC5B,EAAMwB,OAAOK,YAC7DC,sBAAuB,IACvBnC,YAAa,YACboC,2BAA2B,GAE/BC,OAAQ,CACJC,uBAAuB,GAE3BC,MAAO,CACHC,cAAe,iBAGvBd,EAAgBE,QAAU,IAAI,EAAAa,wBAAwBZ,GACtDH,EAAgBE,QAAQc,aAAahE,MAAK,KACtCiE,EACKC,UAAU/F,OAAOkD,OAAOlD,OAAOkD,OAAO,CAAC,EAAGjB,GAAgB0B,GAAY,CACvEO,UAAWP,KAEVN,OAAM,SACN2C,SAAQ,KACTpB,GAAc,EAAM,GACtB,GAEV,CACA,MAAMkB,EAAejB,EAAgBE,QACrC,OAAIJ,GACO,SAAK,EAAAF,WAAY,CAAC,GAEzBhB,EAAMI,cAAgBA,GACd,SAAK,EAAAoC,aAAc,CAAE5E,SAAUyE,EAActD,UAAU,SAAKe,EAAcvD,OAAOkD,OAAO,CAAC,EAAGM,EAAO,CAAEhB,SAAUA,QAEpH,SAAK,EAAAyD,aAAc,CAAE5E,SAAUyE,EAActD,SAAUA,GAAW,EAE7EkC,EAASwB,SCjDe,KACpB,MAAMC,GAAS,IAAAzC,aAYf,OAXA,IAAA0C,YAAU,KACN,MAAMC,EVHHtF,OAAOC,eAAesF,QAAQzF,GUI7BwF,GVDRtF,OAAOC,eAAeuF,WAAW1F,GUGzB2F,QAAQC,IAAI,kBAAkBJ,SAC9BF,EAAOO,QAAQL,IAGfF,EAAOO,QAAQ,IACnB,GACD,CAACP,KACG,SAAK,EAAA1B,WAAY,CAAC,EAAE,EDqC/B,MEnDA,GAAiBC,SAAQ,eAAc,G","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/compat get default export","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"@azure/msal-react\"","webpack://snokam/external commonjs \"@azure/msal-browser\"","webpack://snokam/external commonjs \"next/compat/router\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/./src/storage.ts","webpack://snokam/external commonjs \"@snokam/core\"","webpack://snokam/external commonjs \"@mui/material\"","webpack://snokam/./src/hooks.ts","webpack://snokam/./src/config.ts","webpack://snokam/external commonjs \"@emotion/styled\"","webpack://snokam/./src/components/Provider/styled.tsx","webpack://snokam/./src/components/Provider/Provider.PopupLogin.tsx","webpack://snokam/./src/components/Provider/Provider.Authenticate.tsx","webpack://snokam/./src/components/Provider/index.tsx","webpack://snokam/./src/components/Provider/Provider.Callback.tsx","webpack://snokam/./src/index.tsx"],"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","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\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(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-browser\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/compat/router\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const SessionStorageKey = \"redirect\";\nexport const storeCurrentPath = () => {\n window.sessionStorage.setItem(SessionStorageKey, window.location.pathname);\n};\nexport const getStoredPath = () => {\n return window.sessionStorage.getItem(SessionStorageKey);\n};\nexport const clearStoredPath = () => {\n window.sessionStorage.removeItem(SessionStorageKey);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@snokam/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import { useIsAuthenticated, useMsal } from \"@azure/msal-react\";\nexport const useAuth = () => {\n const { instance, inProgress } = useMsal();\n const account = instance.getAllAccounts()[0];\n const isAuthenticated = useIsAuthenticated();\n const getToken = (scopes) => instance\n .acquireTokenSilent({\n scopes: scopes || [],\n account: account,\n })\n .then(({ accessToken }) => `Bearer ${accessToken}`);\n return {\n getToken,\n isAuthenticated,\n inProgress: inProgress === \"startup\" || inProgress === \"login\",\n instance,\n account,\n };\n};\n","export const loginRequest = {\n scopes: [\"openid\"],\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@emotion/styled\");","import styled from \"@emotion/styled\";\nconst Container = styled.div `\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex: 1;\n`;\nconst Link = styled.a `\n text-decoration: \"underline\";\n`;\nexport default { Container, Link };\n","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useMsal } from \"@azure/msal-react\";\nimport { Button } from \"@mui/material\";\nimport { storeCurrentPath } from \"../../storage\";\nimport { useState } from \"react\";\nimport { useAuth } from \"../../hooks\";\nimport { loginRequest } from \"../../config\";\nimport Styled from \"./styled\";\nexport const PopupLogin = () => {\n const { instance } = useMsal();\n const { account } = useAuth();\n const [popupError, setPopupError] = useState();\n if (popupError) {\n return (_jsxs(Styled.Container, { children: [_jsxs(\"p\", { children: [\"En feil oppstod: \", popupError.errorCode] }), _jsxs(\"span\", { children: [`Prøv å gå direkte til `, _jsx(Styled.Link, { target: \"_blank\", href: \"https://skjer.snokam.no/?enforceLogin=true\", rel: \"noopener noreferrer\", children: \"skjer.snokam.no\" }), \".\"] })] }));\n }\n return (_jsxs(Styled.Container, { children: [\"Du m\\u00E5 logge inn p\\u00E5 nytt for \\u00E5 vise siden\", _jsx(Button, { sx: { marginTop: \"1rem\" }, onClick: () => {\n storeCurrentPath();\n instance\n .loginPopup(Object.assign(Object.assign(Object.assign({}, loginRequest), (account && {\n account,\n })), { redirectUri: \"/blank.html\" }))\n .then(() => setPopupError(undefined))\n .catch((error) => setPopupError(error));\n }, children: \"Fortsett\" })] }));\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { MsalAuthenticationTemplate } from \"@azure/msal-react\";\nimport { storeCurrentPath } from \"../../storage\";\nimport { useRouter } from \"next/compat/router\";\nimport { PageLoader } from \"@snokam/core\";\nimport { PopupLogin } from \"./Provider.PopupLogin\";\nimport { loginRequest } from \"../../config\";\nimport { InteractionType, } from \"@azure/msal-browser\";\nexport const Authenticate = (props) => {\n const { children } = props;\n const { query } = useRouter();\n const username = query.username;\n const interactionType = (query === null || query === void 0 ? void 0 : query.enforceLogin) && (query === null || query === void 0 ? void 0 : query.username)\n ? InteractionType.Silent\n : InteractionType.Redirect;\n const authRequest = Object.assign(Object.assign(Object.assign({}, loginRequest), (username && {\n loginHint: username,\n })), { onRedirectNavigate: (_) => {\n storeCurrentPath();\n } });\n const Loading = () => {\n return _jsx(PageLoader, {});\n };\n return (_jsx(MsalAuthenticationTemplate, { interactionType: interactionType, authenticationRequest: authRequest, errorComponent: PopupLogin, loadingComponent: Loading, children: children }));\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { MsalProvider } from \"@azure/msal-react\";\nimport { PublicClientApplication } from \"@azure/msal-browser\";\nimport { useRouter } from \"next/compat/router\";\nimport { useRef, useState } from \"react\";\nimport { Authenticate } from \"./Provider.Authenticate\";\nimport Callback from \"./Provider.Callback\";\nimport { loginRequest } from \"../../config\";\nimport { PageLoader } from \"@snokam/core\";\nexport const Provider = (props) => {\n const { children, enforceLogin } = props;\n const [ssoLoading, setSsoLoading] = useState(true);\n const { query } = useRouter();\n // Store msalInstance in a ref to ensure it initializes only once\n const msalInstanceRef = useRef(null);\n const username = query.username;\n if (!msalInstanceRef.current) {\n const config = {\n auth: {\n instanceAware: true,\n clientId: props.config.clientId,\n authority: `https://login.microsoftonline.com/${props.config.tenantId}/`,\n postLogoutRedirectUri: \"/\",\n redirectUri: `/callback`,\n navigateToLoginRequestUrl: false,\n },\n system: {\n allowRedirectInIframe: true,\n },\n cache: {\n cacheLocation: \"localStorage\",\n },\n };\n msalInstanceRef.current = new PublicClientApplication(config);\n msalInstanceRef.current.initialize().then(() => {\n msalInstance\n .ssoSilent(Object.assign(Object.assign({}, loginRequest), (username && {\n loginHint: username,\n })))\n .catch(() => { })\n .finally(() => {\n setSsoLoading(false);\n });\n });\n }\n const msalInstance = msalInstanceRef.current;\n if (ssoLoading) {\n return _jsx(PageLoader, {});\n }\n if (query.enforceLogin || enforceLogin) {\n return (_jsx(MsalProvider, { instance: msalInstance, children: _jsx(Authenticate, Object.assign({}, props, { children: children })) }));\n }\n return _jsx(MsalProvider, { instance: msalInstance, children: children });\n};\nProvider.Callback = Callback;\nexport default Provider;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect } from \"react\";\nimport { useRouter } from \"next/compat/router\";\nimport { clearStoredPath, getStoredPath } from \"../../storage\";\nimport { PageLoader } from \"@snokam/core\";\nexport const Callback = () => {\n const router = useRouter();\n useEffect(() => {\n const redirectUrl = getStoredPath();\n if (redirectUrl) {\n clearStoredPath();\n console.log(`Redirecting to ${redirectUrl} ...`);\n router.replace(redirectUrl);\n }\n else {\n router.replace(\"/\");\n }\n }, [router]);\n return _jsx(PageLoader, {});\n};\nexport default Callback;\n","import { Provider } from \"./components/Provider\";\nimport { Authenticate } from \"./components/Provider/Provider.Authenticate\";\nexport { useAuth } from \"./hooks\";\nexport { AuthenticatedTemplate as Authenticated, UnauthenticatedTemplate as Unauthenticated, } from \"@azure/msal-react\";\nexport default { Provider, Authenticate };\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","SessionStorageKey","storeCurrentPath","window","sessionStorage","setItem","location","pathname","useAuth","instance","inProgress","useMsal","account","getAllAccounts","getToken","scopes","acquireTokenSilent","then","accessToken","isAuthenticated","useIsAuthenticated","loginRequest","Container","Link","PopupLogin","popupError","setPopupError","useState","children","errorCode","target","href","rel","Button","sx","marginTop","onClick","loginPopup","assign","redirectUri","undefined","catch","error","Authenticate","props","query","useRouter","username","interactionType","enforceLogin","InteractionType","Silent","Redirect","authRequest","loginHint","onRedirectNavigate","_","MsalAuthenticationTemplate","authenticationRequest","errorComponent","loadingComponent","PageLoader","Provider","ssoLoading","setSsoLoading","msalInstanceRef","useRef","current","config","auth","instanceAware","clientId","authority","tenantId","postLogoutRedirectUri","navigateToLoginRequestUrl","system","allowRedirectInIframe","cache","cacheLocation","PublicClientApplication","initialize","msalInstance","ssoSilent","finally","MsalProvider","Callback","router","useEffect","redirectUrl","getItem","removeItem","console","log","replace"],"sourceRoot":""}
1
+ {"version":3,"file":"index.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,MA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get default export","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"@azure/msal-react\"","webpack://snokam/external commonjs \"@azure/msal-browser\"","webpack://snokam/external commonjs \"next/compat/router\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/./src/storage.ts","webpack://snokam/external commonjs \"@snokam/core\"","webpack://snokam/external commonjs \"@mui/material\"","webpack://snokam/./src/hooks.ts","webpack://snokam/./src/config.ts","webpack://snokam/external commonjs \"@emotion/styled\"","webpack://snokam/./src/components/Provider/styled.tsx","webpack://snokam/./src/components/Provider/Provider.PopupLogin.tsx","webpack://snokam/./src/components/Provider/Provider.Authenticate.tsx","webpack://snokam/./src/components/Provider/index.tsx","webpack://snokam/./src/components/Provider/Provider.Callback.tsx","webpack://snokam/./src/index.tsx"],"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","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\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(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-browser\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/compat/router\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const SessionStorageKey = \"redirect\";\nexport const storeCurrentPath = () => {\n window.sessionStorage.setItem(SessionStorageKey, window.location.pathname);\n};\nexport const getStoredPath = () => {\n return window.sessionStorage.getItem(SessionStorageKey);\n};\nexport const clearStoredPath = () => {\n window.sessionStorage.removeItem(SessionStorageKey);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@snokam/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import { useIsAuthenticated, useMsal } from \"@azure/msal-react\";\nexport const useAuth = () => {\n const { instance, inProgress } = useMsal();\n const account = instance.getAllAccounts()[0];\n const isAuthenticated = useIsAuthenticated();\n const getToken = (scopes) => instance\n .acquireTokenSilent({\n scopes: scopes || [],\n account: account,\n })\n .then(({ accessToken }) => `Bearer ${accessToken}`);\n return {\n getToken,\n isAuthenticated,\n inProgress: inProgress === \"startup\" || inProgress === \"login\",\n instance,\n account,\n };\n};\n","export const loginRequest = {\n scopes: [\"openid\"],\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@emotion/styled\");","import styled from \"@emotion/styled\";\nconst Container = styled.div `\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex: 1;\n`;\nconst Link = styled.a `\n text-decoration: \"underline\";\n`;\nexport default { Container, Link };\n","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useMsal } from \"@azure/msal-react\";\nimport { Button } from \"@mui/material\";\nimport { storeCurrentPath } from \"../../storage\";\nimport { useState } from \"react\";\nimport { useAuth } from \"../../hooks\";\nimport { loginRequest } from \"../../config\";\nimport Styled from \"./styled\";\nexport const PopupLogin = () => {\n const { instance } = useMsal();\n const { account } = useAuth();\n const [popupError, setPopupError] = useState();\n if (popupError) {\n return (_jsxs(Styled.Container, { children: [_jsxs(\"p\", { children: [\"En feil oppstod: \", popupError.errorCode] }), _jsxs(\"span\", { children: [`Prøv å gå direkte til `, _jsx(Styled.Link, { target: \"_blank\", href: \"https://skjer.snokam.no/?enforceLogin=true\", rel: \"noopener noreferrer\", children: \"skjer.snokam.no\" }), \".\"] })] }));\n }\n return (_jsxs(Styled.Container, { children: [\"Du m\\u00E5 logge inn p\\u00E5 nytt for \\u00E5 vise siden\", _jsx(Button, { sx: { marginTop: \"1rem\" }, onClick: () => {\n storeCurrentPath();\n instance\n .loginPopup(Object.assign(Object.assign(Object.assign({}, loginRequest), (account && {\n account,\n })), { redirectUri: \"/blank.html\" }))\n .then(() => setPopupError(undefined))\n .catch((error) => setPopupError(error));\n }, children: \"Fortsett\" })] }));\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { MsalAuthenticationTemplate } from \"@azure/msal-react\";\nimport { storeCurrentPath } from \"../../storage\";\nimport { useRouter } from \"next/compat/router\";\nimport { PageLoader } from \"@snokam/core\";\nimport { PopupLogin } from \"./Provider.PopupLogin\";\nimport { loginRequest } from \"../../config\";\nimport { InteractionType, } from \"@azure/msal-browser\";\nexport const Authenticate = (props) => {\n const { children } = props;\n const { query } = useRouter();\n const username = query.username;\n const interactionType = (query === null || query === void 0 ? void 0 : query.enforceLogin) && (query === null || query === void 0 ? void 0 : query.username)\n ? InteractionType.Silent\n : InteractionType.Redirect;\n const authRequest = Object.assign(Object.assign(Object.assign({}, loginRequest), (username && {\n loginHint: username,\n })), { onRedirectNavigate: (_) => {\n storeCurrentPath();\n } });\n const Loading = () => {\n return _jsx(PageLoader, {});\n };\n return (_jsx(MsalAuthenticationTemplate, { interactionType: interactionType, authenticationRequest: authRequest, errorComponent: PopupLogin, loadingComponent: Loading, children: children }));\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { MsalProvider } from \"@azure/msal-react\";\nimport { PublicClientApplication } from \"@azure/msal-browser\";\nimport { useRouter } from \"next/compat/router\";\nimport { useRef } from \"react\";\nimport { Authenticate } from \"./Provider.Authenticate\";\nimport Callback from \"./Provider.Callback\";\nimport { loginRequest } from \"../../config\";\nexport const Provider = (props) => {\n const { children, enforceLogin } = props;\n const { query } = useRouter();\n // Store msalInstance in a ref to ensure it initializes only once\n const msalInstanceRef = useRef(null);\n const username = query.username;\n if (!msalInstanceRef.current) {\n const config = {\n auth: {\n instanceAware: true,\n clientId: props.config.clientId,\n authority: `https://login.microsoftonline.com/${props.config.tenantId}/`,\n postLogoutRedirectUri: \"/\",\n redirectUri: `/callback`,\n navigateToLoginRequestUrl: false,\n },\n system: {\n allowRedirectInIframe: true,\n },\n cache: {\n cacheLocation: \"localStorage\",\n },\n };\n msalInstanceRef.current = new PublicClientApplication(config);\n msalInstanceRef.current.initialize().then(() => {\n msalInstance\n .ssoSilent(Object.assign(Object.assign({}, loginRequest), (username && {\n loginHint: username,\n })))\n .catch(() => { });\n });\n }\n const msalInstance = msalInstanceRef.current;\n if (query.enforceLogin || enforceLogin) {\n return (_jsx(MsalProvider, { instance: msalInstance, children: _jsx(Authenticate, Object.assign({}, props, { children: children })) }));\n }\n return _jsx(MsalProvider, { instance: msalInstance, children: children });\n};\nProvider.Callback = Callback;\nexport default Provider;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect } from \"react\";\nimport { useRouter } from \"next/compat/router\";\nimport { clearStoredPath, getStoredPath } from \"../../storage\";\nimport { PageLoader } from \"@snokam/core\";\nexport const Callback = () => {\n const router = useRouter();\n useEffect(() => {\n const redirectUrl = getStoredPath();\n if (redirectUrl) {\n clearStoredPath();\n console.log(`Redirecting to ${redirectUrl} ...`);\n router.replace(redirectUrl);\n }\n else {\n router.replace(\"/\");\n }\n }, [router]);\n return _jsx(PageLoader, {});\n};\nexport default Callback;\n","import { Provider } from \"./components/Provider\";\nimport { Authenticate } from \"./components/Provider/Provider.Authenticate\";\nexport { useAuth } from \"./hooks\";\nexport { AuthenticatedTemplate as Authenticated, UnauthenticatedTemplate as Unauthenticated, } from \"@azure/msal-react\";\nexport default { Provider, Authenticate };\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","SessionStorageKey","storeCurrentPath","window","sessionStorage","setItem","location","pathname","useAuth","instance","inProgress","useMsal","account","getAllAccounts","getToken","scopes","acquireTokenSilent","then","accessToken","isAuthenticated","useIsAuthenticated","loginRequest","Container","Link","PopupLogin","popupError","setPopupError","useState","children","errorCode","target","href","rel","Button","sx","marginTop","onClick","loginPopup","assign","redirectUri","undefined","catch","error","Authenticate","props","query","useRouter","username","interactionType","enforceLogin","InteractionType","Silent","Redirect","authRequest","loginHint","onRedirectNavigate","_","MsalAuthenticationTemplate","authenticationRequest","errorComponent","loadingComponent","PageLoader","Provider","msalInstanceRef","useRef","current","config","auth","instanceAware","clientId","authority","tenantId","postLogoutRedirectUri","navigateToLoginRequestUrl","system","allowRedirectInIframe","cache","cacheLocation","PublicClientApplication","initialize","msalInstance","ssoSilent","MsalProvider","Callback","router","useEffect","redirectUrl","getItem","removeItem","console","log","replace"],"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.0.54-alpha.0",
4
+ "version": "2.0.55",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -30,7 +30,7 @@
30
30
  "@emotion/react": "^11.14.0",
31
31
  "@emotion/styled": "^11.14.0",
32
32
  "@mui/material": "^6.4.3",
33
- "@snokam/core": "^1.3.41-alpha.0"
33
+ "@snokam/core": "^1.3.41"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": "*",
@@ -57,5 +57,5 @@
57
57
  ]
58
58
  }
59
59
  },
60
- "gitHead": "8d05e67966cbe219c66fde27d6ef54e3872d9fea"
60
+ "gitHead": "a540196eb28089916e4eb90377add8b8f1c3aa17"
61
61
  }