import { PersonProfileApi } from '@openapi/idm';
import store from '@state/store';

const personProfileApi = new PersonProfileApi();
export const AUTH_LOCAL = 'IDP_LOCAL';
export const AUTH_ESIA = 'IDP_ESIA';

export function getAuthorizationType(profile: any): string | null {
  return (
    profile.amr?.find((i: string) => i === AUTH_ESIA || i === AUTH_LOCAL) ??
    null
  );
}
