Skip to main content

foundation-comms.credentialmanager.normaliselegacycredentialdata

Home > @genesislcap/foundation-comms > CredentialManager > normaliseLegacyCredentialData

CredentialManager.normaliseLegacyCredentialData() method

Normalise legacy credential data.

Signature:

normaliseLegacyCredentialData(data?: CredentialData, cookie?: CredentialData): [CredentialData | undefined, boolean];

Parameters

Parameter

Type

Description

data

CredentialData

(Optional) The credential data to normalise.

cookie

CredentialData

(Optional) The unknown cookie data to normalise.

Returns:

[CredentialData | undefined, boolean]

A tuple of the best effort normalisation of the inputs to the CredentialData format, and a boolean to indicate if we can remove the cookie.

Remarks

Older applications may have legacy credential data that needs migrating to the latest format the manager expects. If the input CredentialData is already formatted as such, it will be returned as is. Otherwise, we check if any cookie input is already formatted as such, and if so return it as CredentialData. If neither inputs are valid, we will attempt a best effort normalisation to create valid CredentialData, or abort and return undefined.