{"version":3,"sources":["webpack:///./src/features/api-authorization/login.vue?1998","webpack:///./src/features/api-authorization/login.vue?4631","webpack:///./src/features/api-authorization/login.vue?8172","webpack:///./src/features/api-authorization/login.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","type","staticClass","_v","_s","message","_e","staticRenderFns","action","Login","login","getReturnUrl","ProcessingLogin","LoginCallback","processLoginCallback","ProcessingLoginCallback","LoginFailed","params","URLSearchParams","window","location","search","error","get","Message","Profile","redirectToProfile","Register","redirectToRegister","Error","returnUrl","state","signIn","result","status","Redirect","Success","Fail","navigateToReturnUrl","url","href","completeSignIn","origin","redirectToApiAuthorizationPath","IdentityRegisterPath","ReturnUrl","encodeURI","IdentityManagePath","apiAuthorizationPath","redirectUrl","replace","component","VAlert","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,QAAQ,CAACE,MAAM,CAAC,MAAQ,WAAW,CAACF,EAAG,QAAQ,CAACI,YAAY,QAAQ,CAACR,EAAIS,GAAG,IAAIT,EAAIU,GAAGV,EAAIW,aAAa,IAAI,GAAGX,EAAIY,MAAM,IAAI,IAAI,IACpdC,EAAkB,G,gOCiCD,EAArB,wDADA,iD,0BAII,EAAAF,QAAkB,KAElB,EAAAJ,KAAe,OANnB,EACA,8CAOI,WACI,IAAMO,EAASb,KAAKa,OACpB,OAAQA,GACJ,KAAK,OAAaC,MAC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AAiCX,OAAOC,SAASsB,OAAjD,OAxFf,gCA2FI,WACI/C,KAAKgD,+BAAL,UAAuC,OAAiBC,qBAAxD,YAAgF,OAAoBC,UAApG,YAAiHC,UAAU,OAAiBrC,WA5FpJ,+BA+FI,WACId,KAAKgD,+BAA+B,OAAiBI,sBAhG7D,4CAmGI,SAA+BC,GAC3B,IAAMC,EAAc,GAAH,OAAM9B,OAAOC,SAASsB,QAAtB,OAA+BM,GAIhD7B,OAAOC,SAAS8B,QAAQD,KAxGhC,iCA2GI,SAAoBnB,GAGhBX,OAAOC,SAAS8B,QAAQpB,OA9GhC,GAAmC,QACvB,QAAP,kB,6BADgB,EAAK,QADzB,QACoB,WClC2b,I,kFCO5cqB,EAAY,eACd,EACA1D,EACAc,GACA,EACA,KACA,KACA,MAIa,aAAA4C,EAAiB,QAQhC,IAAkBA,EAAW,CAACC,SAAA,KAAOC,OAAA,KAAKC,aAAA,KAAWC,OAAA","file":"js/chunk-2d0c87c4.e852bbdd.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('v-row',{attrs:{\"align\":\"center\"}},[_c('v-col',{staticClass:\"grow\"},[_vm._v(\" \"+_vm._s(_vm.message))])],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\nimport authService from './authorize-service';\nimport { State } from './authorize-service';\nimport { AuthenticationResultStatus } from './authorize-service';\nimport { LoginActions, QueryParameterNames, ApplicationPaths, AuthMessages } from './api-authorization-constants';\nimport Vue from 'vue';\nimport Component from 'vue-class-component';\nimport { Prop } from 'vue-property-decorator';\n\n// The main responsibility of this component is to handle the user's login process.\n// This is the starting point for the login process. Any component that needs to authenticate\n// a user can simply perform a redirect to this component with a returnUrl query parameter and\n// let the component perform the login and return back to the return url.\n@Component\nexport default class Login extends Vue {\n @Prop() action: LoginActions;\n\n message: string = null;\n\n type: string = 'info';\n\n created() {\n const action = this.action;\n switch (action) {\n case LoginActions.Login:\n this.login(this.getReturnUrl());\n this.message = AuthMessages.ProcessingLogin;\n this.type = 'info';\n break;\n\n case LoginActions.LoginCallback:\n this.processLoginCallback();\n this.message = AuthMessages.ProcessingLoginCallback;\n this.type = 'info';\n break;\n\n case LoginActions.LoginFailed:\n const params = new URLSearchParams(window.location.search);\n const error = params.get(QueryParameterNames.Message);\n this.message = error || AuthMessages.LoginFailed;\n this.type = 'error';\n break;\n\n case LoginActions.Profile:\n this.redirectToProfile();\n break;\n\n case LoginActions.Register:\n this.redirectToRegister();\n break;\n\n default:\n throw new Error(`Invalid action '${action}'`);\n }\n }\n\n async login(returnUrl: string) {\n const state = { returnUrl };\n\n const result = await authService.signIn(state);\n\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 status result ${result.status}.`);\n }\n }\n\n async processLoginCallback() {\n const url = window.location.href;\n const result = await authService.completeSignIn(url);\n\n switch (result.status) {\n case AuthenticationResultStatus.Redirect:\n // There should not be any redirects as the only time completeSignIn 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 '${result.status}'.`);\n }\n }\n\n getReturnUrl(state?: State) {\n return (state && state.returnUrl) || `${window.location.origin}/`\n }\n\n redirectToRegister() {\n this.redirectToApiAuthorizationPath(`${ApplicationPaths.IdentityRegisterPath}?${QueryParameterNames.ReturnUrl}=${encodeURI(ApplicationPaths.Login)}`);\n }\n\n redirectToProfile() {\n this.redirectToApiAuthorizationPath(ApplicationPaths.IdentityManagePath);\n }\n\n redirectToApiAuthorizationPath(apiAuthorizationPath: string) {\n const redirectUrl = `${window.location.origin}${apiAuthorizationPath}`;\n // It's important that we do a replace here so that when the user hits the back arrow on the\n // browser he gets sent back to where it was on the app instead of to an endpoint on this\n // component.\n window.location.replace(redirectUrl);\n }\n\n navigateToReturnUrl(returnUrl: string) {\n // It's important that we do a replace here so that we remove the callback uri with the\n // fragment containing the tokens from the browser history.\n 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!./login.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!./login.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./login.vue?vue&type=template&id=1888d52a&\"\nimport script from \"./login.vue?vue&type=script&lang=ts&\"\nexport * from \"./login.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 { VCol } from 'vuetify/lib/components/VGrid';\nimport { VContainer } from 'vuetify/lib/components/VGrid';\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VAlert,VCol,VContainer,VRow})\n"],"sourceRoot":""}