{"version":3,"sources":["webpack:///./src/features/api-authorization/logout.vue?4a68","webpack:///./src/features/api-authorization/logout.vue?e5ec","webpack:///./src/features/api-authorization/logout.vue?37fc","webpack:///./src/features/api-authorization/logout.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","type","staticStyle","staticClass","_v","_s","message","_e","staticRenderFns","exibirVoltar","isReady","authenticated","action","Logout","logout","getReturnUrl","ProcessingLogout","LogoutCallback","processLogoutCallback","ProcessingLogoutCallback","LoggedOut","Error","populateAuthenticationState","returnUrl","state","isAuthenticated","isauthenticated","signOut","result","status","Redirect","Success","Fail","navigateToReturnUrl","url","window","location","href","completeSignOut","params","URLSearchParams","search","fromQuery","get","ReturnUrl","startsWith","origin","replace","component","VAlert","VBtn","VCol","VContainer","VRow"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,cAAc,CAACE,MAAM,CAAC,MAAQ,KAAK,CAACF,EAAG,QAAQ,CAACE,MAAM,CAAC,QAAU,WAAW,CAACF,EAAG,QAAQ,CAACE,MAAM,CAAC,KAAO,KAAK,GAAK,IAAI,GAAK,MAAM,CAAEN,EAAW,QAAEI,EAAG,UAAU,CAACE,MAAM,CAAC,KAAO,0BAA0B,UAAY,GAAG,KAAO,GAAG,KAAON,EAAIO,OAAO,CAACH,EAAG,SAAS,CAACI,YAAY,CAAC,QAAU,QAAQF,MAAM,CAAC,IAAM,4DAA4DF,EAAG,QAAQ,CAACE,MAAM,CAAC,MAAQ,WAAW,CAACF,EAAG,QAAQ,CAACK,YAAY,QAAQ,CAACT,EAAIU,GAAG,IAAIV,EAAIW,GAAGX,EAAIY,YAAaZ,EAAgB,aAAEI,EAAG,QAAQ,CAACK,YAAY,UAAU,CAACL,EAAG,QAAQ,CAACE,MAAM,CAAC,GAAK,MAAM,CAACN,EAAIU,GAAG,aAAa,GAAGV,EAAIa,MA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1B,KAAKsC,oBAAoBtC,KAAKoB,aAAaa,EAAOJ,QAXpE,mDAeY7B,KAAKW,QAAUsB,EAAOtB,QAflC,mCAmBkB,IAAIe,MAAM,yCAnB5B,iDArEJ,2JA4FI,8FACI1B,KAAKe,SAAU,EADnB,gDA5FJ,mFAgGI,SAAac,GACT,IAAMe,EAAS,IAAIC,gBAAgBL,OAAOC,SAASK,QAC7CC,EAAYH,EAAOI,IAAI,OAAoBC,WAEjD,GAAIF,IAAcA,EAAUG,WAAW,OAASH,EAAUG,WAAV,UAAwBV,OAAOC,SAASU,OAAxC,MAE5C,MAAM,IAAIzB,MAAM,yFAGpB,OAAQG,GAASA,EAAMD,WACnBmB,GADG,UAEAP,OAAOC,SAASU,QAFhB,OAEyB,OAAiB1B,aA3GzD,iCA8GI,SAAoBG,GAChB,OAAOY,OAAOC,SAASW,QAAQxB,OA/GvC,GAAoC,QACxB,QAAP,kB,6BADgB,EAAM,QAD1B,QACoB,WCpC4b,I,8FCO7cyB,EAAY,eACd,EACAvD,EACAe,GACA,EACA,KACA,KACA,MAIa,aAAAwC,EAAiB,QAShC,IAAkBA,EAAW,CAACC,SAAA,KAAOC,OAAA,KAAKC,OAAA,KAAKC,aAAA,KAAWC,OAAA","file":"js/chunk-2d0b9bd4.48406fed.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',{attrs:{\"fluid\":\"\"}},[_c('v-row',{attrs:{\"justify\":\"center\"}},[_c('v-col',{attrs:{\"cols\":\"12\",\"sm\":\"8\",\"md\":\"4\"}},[(_vm.message)?_c('v-alert',{attrs:{\"icon\":\"mdi-shield-lock-outline\",\"prominent\":\"\",\"text\":\"\",\"type\":_vm.type}},[_c('iframe',{staticStyle:{\"display\":\"none\"},attrs:{\"src\":\"https://contou.com.br/carrinho/#/authentication/logout\"}}),_c('v-row',{attrs:{\"align\":\"center\"}},[_c('v-col',{staticClass:\"grow\"},[_vm._v(\" \"+_vm._s(_vm.message))]),(_vm.exibirVoltar)?_c('v-col',{staticClass:\"shrink\"},[_c('v-btn',{attrs:{\"to\":\"/\"}},[_vm._v(\"Voltar\")])],1):_vm._e()],1)],1):_vm._e()],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport authService from './authorize-service';\nimport { State } from './authorize-service';\nimport { AuthenticationResultStatus } from './authorize-service';\nimport { QueryParameterNames, LogoutActions, ApplicationPaths, AuthMessages } from './api-authorization-constants';\nimport Vue from 'vue';\nimport Component from 'vue-class-component';\nimport { Prop } from 'vue-property-decorator';\n// The main responsibility of this component is to handle the user's logout process.\n// This is the starting point for the logout process, which is usually initiated when a\n// user clicks on the logout button on the LoginMenu component.\n@Component\nexport default class Logout extends Vue {\n @Prop() action: LogoutActions;\n\n message: string = null;\n\n type: string = 'info';\n\n exibirVoltar = false;\n\n isReady = false;\n\n authenticated = false;\n\n created() {\n const action = this.action;\n\n switch (action) {\n case LogoutActions.Logout:\n this.logout(this.getReturnUrl());\n this.message = AuthMessages.ProcessingLogout;\n this.type = 'info';\n break;\n\n case LogoutActions.LogoutCallback:\n this.processLogoutCallback();\n this.message = AuthMessages.ProcessingLogoutCallback;\n this.type = 'info';\n break;\n\n case LogoutActions.LoggedOut:\n this.isReady = true;\n this.message = AuthMessages.LoggedOut;\n this.type = 'success';\n this.exibirVoltar = true;\n break;\n\n default:\n throw new Error(`Invalid action '${action}'`);\n }\n\n this.populateAuthenticationState();\n }\n\n async logout(returnUrl: string) {\n const state = { returnUrl };\n const isauthenticated = await authService.isAuthenticated();\n\n if (isauthenticated) {\n const result = await authService.signOut(state);\n switch (result.status) {\n case AuthenticationResultStatus.Redirect:\n break;\n\n case AuthenticationResultStatus.Success:\n await this.navigateToReturnUrl(returnUrl);\n break;\n\n case AuthenticationResultStatus.Fail:\n this.message = result.message;\n break;\n\n default:\n throw new Error(\"Invalid authentication result status.\");\n }\n } else {\n this.message = \"You successfully logged out!\";\n }\n }\n\n async processLogoutCallback() {\n const url = window.location.href;\n const result = await authService.completeSignOut(url);\n\n switch (result.status) {\n case AuthenticationResultStatus.Redirect:\n // There should not be any redirects as the only time completeAuthentication finishes\n // is when we are doing a redirect sign in flow.\n throw new Error('Should not redirect.');\n\n case AuthenticationResultStatus.Success:\n await this.navigateToReturnUrl(this.getReturnUrl(result.state));\n break;\n\n case AuthenticationResultStatus.Fail:\n this.message = result.message;\n break;\n\n default:\n throw new Error(\"Invalid authentication result status.\");\n }\n }\n\n async populateAuthenticationState() {\n this.isReady = true;\n }\n\n getReturnUrl(state?: State) {\n const params = new URLSearchParams(window.location.search);\n const fromQuery = params.get(QueryParameterNames.ReturnUrl);\n\n if (fromQuery && !fromQuery.startsWith('/') && !fromQuery.startsWith(`${window.location.origin}/`)) {\n // This is an extra check to prevent open redirects.\n throw new Error(\"Invalid return url. The return url needs to have the same origin as the current page.\")\n }\n\n return (state && state.returnUrl) ||\n fromQuery ||\n `${window.location.origin}${ApplicationPaths.LoggedOut}`;\n }\n\n navigateToReturnUrl(returnUrl: string) {\n return window.location.replace(returnUrl);\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/vuetify-loader/lib/loader.js??ref--19-0!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./logout.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/vuetify-loader/lib/loader.js??ref--19-0!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./logout.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./logout.vue?vue&type=template&id=519ab73a&\"\nimport script from \"./logout.vue?vue&type=script&lang=ts&\"\nexport * from \"./logout.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VContainer } from 'vuetify/lib/components/VGrid';\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VAlert,VBtn,VCol,VContainer,VRow})\n"],"sourceRoot":""}