8 lines
381 B
JavaScript
8 lines
381 B
JavaScript
|
import { TokenProviderError } from "@smithy/property-provider";
|
||
|
import { REFRESH_MESSAGE } from "./constants";
|
||
|
export const validateTokenKey = (key, value, forRefresh = false) => {
|
||
|
if (typeof value === "undefined") {
|
||
|
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
||
|
}
|
||
|
};
|