UNPKG

4.12 kBSource Map (JSON)View Raw
1{"version":3,"file":"request-password.component.js","sourceRoot":"","sources":["../../../../../../.ng_build/auth/components/request-password/request-password.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAS5D,MAAM,OAAO,0BAA0B;IAWrC,YAAsB,OAAsB,EACG,UAAU,EAAE,EACrC,EAAqB,EACrB,MAAc;QAHd,YAAO,GAAP,OAAO,CAAe;QACG,YAAO,GAAP,OAAO,CAAK;QACrC,OAAE,GAAF,EAAE,CAAmB;QACrB,WAAM,GAAN,MAAM,CAAQ;QAZpC,kBAAa,GAAW,CAAC,CAAC;QAC1B,iBAAY,GAAQ,EAAE,CAAC;QACvB,aAAQ,GAAW,EAAE,CAAC;QAEtB,cAAS,GAAG,KAAK,CAAC;QAClB,WAAM,GAAa,EAAE,CAAC;QACtB,aAAQ,GAAa,EAAE,CAAC;QACxB,SAAI,GAAQ,EAAE,CAAC;QAOb,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,qCAAqC,CAAC,CAAC;QAChF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,oCAAoC,CAAC,CAAC;QAC9E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,gCAAgC,CAAC,CAAC;IACxE,CAAC;IAED,WAAW;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAoB,EAAE,EAAE;YACxF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE;gBACtB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;aACtC;iBAAM;gBACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;aAClC;YAED,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACtC,IAAI,QAAQ,EAAE;gBACZ,UAAU,CAAC,GAAG,EAAE;oBACd,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAC7C,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;aACxB;YACD,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,GAAW;QACxB,OAAO,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;;;YAnDF,SAAS,SAAC;gBACT,QAAQ,EAAE,0BAA0B;gBAEpC,izEAAgD;gBAChD,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YARQ,aAAa;4CAqBP,MAAM,SAAC,eAAe;YA1BH,iBAAiB;YAC1C,MAAM","sourcesContent":["/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { NB_AUTH_OPTIONS } from '../../auth.options';\nimport { getDeepFromObject } from '../../helpers';\n\nimport { NbAuthService } from '../../services/auth.service';\nimport { NbAuthResult } from '../../services/auth-result';\n\n@Component({\n selector: 'nb-request-password-page',\n styleUrls: ['./request-password.component.css'],\n templateUrl: './request-password.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NbRequestPasswordComponent {\n\n redirectDelay: number = 0;\n showMessages: any = {};\n strategy: string = '';\n\n submitted = false;\n errors: string[] = [];\n messages: string[] = [];\n user: any = {};\n\n constructor(protected service: NbAuthService,\n @Inject(NB_AUTH_OPTIONS) protected options = {},\n protected cd: ChangeDetectorRef,\n protected router: Router) {\n\n this.redirectDelay = this.getConfigValue('forms.requestPassword.redirectDelay');\n this.showMessages = this.getConfigValue('forms.requestPassword.showMessages');\n this.strategy = this.getConfigValue('forms.requestPassword.strategy');\n }\n\n requestPass(): void {\n this.errors = this.messages = [];\n this.submitted = true;\n\n this.service.requestPassword(this.strategy, this.user).subscribe((result: NbAuthResult) => {\n this.submitted = false;\n if (result.isSuccess()) {\n this.messages = result.getMessages();\n } else {\n this.errors = result.getErrors();\n }\n\n const redirect = result.getRedirect();\n if (redirect) {\n setTimeout(() => {\n return this.router.navigateByUrl(redirect);\n }, this.redirectDelay);\n }\n this.cd.detectChanges();\n });\n }\n\n getConfigValue(key: string): any {\n return getDeepFromObject(this.options, key, null);\n }\n}\n"]}
\No newline at end of file