{"version":3,"file":"maqta-formio-angular-auth.mjs","sources":["../../../projects/angular-formio/auth/src/auth.config.ts","../../../projects/angular-formio/auth/src/auth.service.ts","../../../projects/angular-formio/auth/src/auth.component.ts","../../../projects/angular-formio/auth/src/auth.component.html","../../../projects/angular-formio/auth/src/login/login.component.ts","../../../projects/angular-formio/auth/src/login/login.component.html","../../../projects/angular-formio/auth/src/register/register.component.ts","../../../projects/angular-formio/auth/src/register/register.component.html","../../../projects/angular-formio/auth/src/resetpass/resetpass.component.ts","../../../projects/angular-formio/auth/src/resetpass/resetpass.component.html","../../../projects/angular-formio/auth/src/auth.routes.ts","../../../projects/angular-formio/auth/src/auth.module.ts","../../../projects/angular-formio/auth/src/public_api.ts","../../../projects/angular-formio/auth/src/maqta-formio-angular-auth.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\nexport interface FormioAuthFormConfig {\r\n  path?: string;\r\n  form?: string;\r\n  component?: any;\r\n}\r\n\r\nexport interface FormioAuthRouteConfig {\r\n  auth?: any;\r\n  login?: any;\r\n  register?: any;\r\n  resetpass?: any;\r\n}\r\n\r\n@Injectable()\r\nexport class FormioAuthConfig {\r\n  component?: any;\r\n  delayAuth?: any;\r\n  login?: FormioAuthFormConfig;\r\n  register?: FormioAuthFormConfig;\r\n  resetpass?: FormioAuthFormConfig;\r\n  oauth?: FormioOAuthConfig;\r\n}\r\n\r\n\r\nexport interface FormioOAuthConfig {\r\n  type: FormioOauthType;\r\n  options: FormioOktaConfig | FormioSamlConfig;\r\n}\r\n\r\nexport enum FormioOauthType {\r\n  okta = 'okta',\r\n  saml = 'saml',\r\n}\r\n\r\nexport interface FormioOktaConfig extends OktaConfig {\r\n  formio?: any;\r\n}\r\n\r\nexport interface FormioSamlConfig {\r\n  relay: string;\r\n}\r\n\r\n// for more details about Okta configuration options see https://github.com/okta/okta-auth-js#configuration-reference\r\nexport interface OktaConfig {\r\n  url?: string;\r\n  tokenManager?: OktaTokenManagerConfig;\r\n  issuer?: string;\r\n  clientId?: string;\r\n  redirectUri?: string;\r\n  postLogoutRedirectUri?: string;\r\n  pkce?: boolean;\r\n  authorizeUrl?: string;\r\n  userinfoUrl?: string;\r\n  tokenUrl?: string;\r\n  ignoreSignature?: boolean;\r\n  maxClockSkew?: number;\r\n  scopes?: string[];\r\n  httpRequestClient?: Function;\r\n}\r\n\r\nexport interface OktaTokenManagerConfig {\r\n  storage?: string | {\r\n    getItem?: Function;\r\n    setItem?: Function;\r\n  };\r\n  secure?: boolean;\r\n  autoRenew?: boolean;\r\n  expireEarlySeconds?: number;\r\n  storageKey?: string;\r\n}\r\n","import { EventEmitter, Injectable, Inject } from '@angular/core';\nimport { FormioAuthConfig } from './auth.config';\nimport { FormioAppConfig } from '@maqta/formio-angular';\nimport { get, each } from 'lodash';\nimport { Formio } from 'formiojs';\n\n@Injectable()\nexport class FormioAuthService {\n  public user: any;\n  public authenticated = false;\n\n  public loginForm: string;\n  public onLogin: EventEmitter<object>;\n  public onLogout: EventEmitter<object>;\n\n  public registerForm: string;\n  public onRegister: EventEmitter<object>;\n  public onUser: EventEmitter<object>;\n  public onError: EventEmitter<any>;\n\n  public resetPassForm: string;\n  public onResetPass: EventEmitter<object>;\n\n  public ready: Promise<boolean>;\n  public readyResolve: any;\n  public readyReject: any;\n\n  public projectReady?: Promise<any>;\n  public accessReady?: Promise<any>;\n  public userReady?: Promise<any>;\n  public formAccess: any = {};\n  public submissionAccess: any = {};\n  public roles: any;\n  public is: any = {};\n\n  constructor(\n    public appConfig: FormioAppConfig,\n    public config: FormioAuthConfig\n  ) {\n    this.user = null;\n\n    if (this.appConfig && this.appConfig.appUrl) {\n      Formio.setBaseUrl(this.appConfig.apiUrl);\n      Formio.setProjectUrl(this.appConfig.appUrl);\n      Formio.formOnly = !!this.appConfig.formOnly;\n    } else {\n      console.error('You must provide an AppConfig within your application!');\n    }\n\n    this.loginForm =\n      this.appConfig.appUrl +\n      '/' +\n      get(this.config, 'login.form', 'user/login');\n    this.registerForm =\n      this.appConfig.appUrl +\n      '/' +\n      get(this.config, 'register.form', 'user/register');\n    this.resetPassForm =\n      this.appConfig.appUrl +\n      '/' +\n      get(this.config, 'register.form', 'resetpass');\n    this.onLogin = new EventEmitter();\n    this.onLogout = new EventEmitter();\n    this.onRegister = new EventEmitter();\n    this.onUser = new EventEmitter();\n    this.onError = new EventEmitter();\n\n    this.ready = new Promise((resolve: any, reject: any) => {\n      this.readyResolve = resolve;\n      this.readyReject = reject;\n    });\n\n    // Register for the core events.\n    Formio.events.on('formio.badToken', () => this.logoutError());\n    Formio.events.on('formio.sessionExpired', () => this.logoutError());\n    if (!this.config.delayAuth) {\n      this.init();\n    }\n  }\n\n  onLoginSubmit(submission: object) {\n    this.setUser(submission);\n    this.onLogin.emit(submission);\n  }\n\n  onRegisterSubmit(submission: object) {\n    this.setUser(submission);\n    this.onRegister.emit(submission);\n  }\n\n  onResetPassSubmit(submission: object) {\n    this.onResetPass.emit(submission);\n  }\n\n  init() {\n    this.projectReady = Formio.makeStaticRequest(this.appConfig.appUrl).then(\n      (project: any) => {\n        each(project.access, (access: any) => {\n          this.formAccess[access.type] = access.roles;\n        });\n      },\n      (): any => {\n        this.formAccess = {};\n        return null;\n      }\n    );\n\n    // Get the access for this project.\n    this.accessReady = Formio.makeStaticRequest(\n      this.appConfig.appUrl + '/access'\n    ).then(\n      (access: any) => {\n        each(access.forms, (form: any) => {\n          this.submissionAccess[form.name] = {};\n          form.submissionAccess.forEach((subAccess: any) => {\n            this.submissionAccess[form.name][subAccess.type] = subAccess.roles;\n          });\n        });\n        this.roles = access.roles;\n        return access;\n      },\n      (): any => {\n        this.roles = {};\n        return null;\n      }\n    );\n\n    let currentUserPromise: Promise<any>;\n    if (this.config.oauth) {\n      // Make a fix to the hash to remove starting \"/\" that angular might put there.\n      if (window.location.hash && window.location.hash.match(/^#\\/access_token/)) {\n        history.pushState(null, null, window.location.hash.replace(/^#\\/access_token/, '#access_token'));\n      }\n\n      // Initiate the SSO if they provide oauth settings.\n      currentUserPromise = Formio.ssoInit(this.config.oauth.type, this.config.oauth.options);\n    } else {\n      currentUserPromise = Formio.currentUser();\n    }\n\n    this.userReady = currentUserPromise.then((user: any) => {\n      this.setUser(user);\n      return user;\n    });\n\n    // Trigger we are redy when all promises have resolved.\n    if (this.accessReady) {\n      this.accessReady\n        .then(() => this.projectReady)\n        .then(() => this.userReady)\n        .then(() => this.readyResolve(true))\n        .catch((err: any) => this.readyReject(err));\n    }\n  }\n\n  setUser(user: any) {\n    const namespace = Formio.namespace || 'formio';\n    if (user) {\n      this.user = user;\n      localStorage.setItem(`${namespace}AppUser`, JSON.stringify(user));\n      this.setUserRoles();\n    } else {\n      this.user = null;\n      this.is = {};\n      localStorage.removeItem(`${namespace}AppUser`);\n      Formio.clearCache();\n      Formio.setUser(null);\n    }\n\n    this.authenticated = !!Formio.getToken();\n    this.onUser.emit(this.user);\n  }\n\n  setUserRoles() {\n    if (this.accessReady) {\n      this.accessReady.then(() => {\n        each(this.roles, (role: any, roleName: string) => {\n          if (this.user.roles.indexOf(role._id) !== -1) {\n            this.is[roleName] = true;\n          }\n        });\n      });\n    }\n  }\n\n  logoutError() {\n    this.setUser(null);\n    const namespace = Formio.namespace || 'formio';\n    localStorage.removeItem(`${namespace}Token`);\n    this.onError.emit();\n  }\n\n  logout() {\n    this.setUser(null);\n    const namespace = Formio.namespace || 'formio';\n    localStorage.removeItem(`${namespace}Token`);\n    Formio.logout()\n      .then(() => this.onLogout.emit())\n      .catch(() => this.logoutError());\n  }\n}\n","import { Component } from '@angular/core';\r\n@Component({\r\n  templateUrl: './auth.component.html'\r\n})\r\nexport class FormioAuthComponent {}\r\n","<div class=\"card card-primary panel panel-default\">\r\n  <div class=\"card-header panel-heading\">\r\n    <ul class=\"nav nav-tabs card-header-tabs\">\r\n      <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"login\" routerLinkActive=\"active\">Login</a></li>\r\n      <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"register\" routerLinkActive=\"active\">Register</a></li>\r\n      <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"resetpass\" routerLinkActive=\"active\">Reset Password</a></li>\r\n    </ul>\r\n  </div>\r\n  <div class=\"card-body panel-body\">\r\n    <router-outlet></router-outlet>\r\n  </div>\r\n</div>\r\n","import { Component } from '@angular/core';\r\nimport { FormioAuthService } from '../auth.service';\r\n@Component({\r\n  templateUrl: './login.component.html'\r\n})\r\nexport class FormioAuthLoginComponent {\r\n  constructor(public service: FormioAuthService) {}\r\n}\r\n","<formio [src]=\"service.loginForm\" (submit)=\"service.onLoginSubmit($event)\"></formio>\r\n","import { Component } from '@angular/core';\r\nimport { FormioAuthService } from '../auth.service';\r\n@Component({\r\n  templateUrl: './register.component.html'\r\n})\r\nexport class FormioAuthRegisterComponent {\r\n  constructor(public service: FormioAuthService) {}\r\n}\r\n","<formio [src]=\"service.registerForm\" (submit)=\"service.onRegisterSubmit($event)\"></formio>\r\n","import { Component } from '@angular/core';\r\nimport { FormioAuthService } from '../auth.service';\r\n@Component({\r\n  templateUrl: './resetpass.component.html'\r\n})\r\nexport class FormioResetPassComponent {\r\n  constructor(public service: FormioAuthService) {}\r\n}\r\n","<formio [src]=\"service.resetPassForm\" (submit)=\"service.onResetPassSubmit($event)\"></formio>\r\n","import { Routes } from '@angular/router';\r\nimport { FormioAuthRouteConfig } from './auth.config';\r\nimport { FormioAuthComponent } from './auth.component';\r\nimport { FormioAuthLoginComponent } from './login/login.component';\r\nimport { FormioAuthRegisterComponent } from './register/register.component';\r\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\r\n\r\nexport function FormioAuthRoutes(config?: FormioAuthRouteConfig): Routes {\r\n  return [\r\n    {\r\n      path: '',\r\n      component: config && config.auth ? config.auth : FormioAuthComponent,\r\n      children: [\r\n        {\r\n          path: '',\r\n          redirectTo: 'login',\r\n          pathMatch: 'full'\r\n        },\r\n        {\r\n          path: 'login',\r\n          component: config && config.login ? config.login : FormioAuthLoginComponent\r\n        },\r\n        {\r\n          path: 'register',\r\n          component: config && config.register ? config.register : FormioAuthRegisterComponent\r\n        },\r\n        {\r\n          path: 'resetpass',\r\n          component: config && config.resetpass ? config.resetpass : FormioResetPassComponent\r\n        }\r\n      ]\r\n    }\r\n  ];\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { FormioModule } from '@maqta/formio-angular';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthRoutes } from './auth.routes';\nimport { extendRouter } from '@maqta/formio-angular';\n\n@NgModule({\n  imports: [\n    CommonModule,\n    FormioModule,\n    RouterModule\n  ],\n  declarations: [\n    FormioAuthComponent,\n    FormioAuthLoginComponent,\n    FormioAuthRegisterComponent,\n    FormioResetPassComponent\n  ]\n})\nexport class FormioAuth {\n  static forRoot(config?: FormioAuthRouteConfig): any {\n    return extendRouter(FormioAuth, config, FormioAuthRoutes);\n  }\n  static forChild(config?: FormioAuthRouteConfig): any {\n    return extendRouter(FormioAuth, config, FormioAuthRoutes);\n  }\n}\n","/*\r\n * Public API Surface of angular-formio\r\n */\r\n\r\nexport * from './index';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAgBa,gBAAgB;;6GAAhB,gBAAgB;iHAAhB,gBAAgB;2FAAhB,gBAAgB;kBAD5B,UAAU;;AAgBX,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe;;MCxBd,iBAAiB;IA4B5B,YACS,SAA0B,EAC1B,MAAwB;QADx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