import { Injectable } from '@angular/core';
import { EncrDecrService } from "src/app/services/encr-decr.service";
import { OidcSecurityService } from 'angular-auth-oidc-client';

@Injectable({
  providedIn: 'root'
})
export class StateService {

  kommunenummer: any;
  pid: any;


  constructor(private encrDecr: EncrDecrService, private oidcSecurityService: OidcSecurityService) {
   }

   init(){
    this.oidcSecurityService.getUserData().subscribe( (userInfo: any) => {
      this.kommunenummer = userInfo["Kommunenummer"];
      this.pid = userInfo["pid"];
    });
   }

  public getKommunenummer(){
    return this.kommunenummer;
  }

  public getPid(){
    return this.pid;
  }

}
