Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
1.1 KiB
Text
21 lines
1.1 KiB
Text
import { setCredentialFeature } from "@aws-sdk/core/client";
|
|
import { CredentialsProviderError } from "@smithy/property-provider";
|
|
import { getProfileName, parseKnownFiles } from "@smithy/shared-ini-file-loader";
|
|
import { LoginCredentialsFetcher } from "./LoginCredentialsFetcher";
|
|
export const fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
|
|
init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
|
|
const profiles = await parseKnownFiles(init || {});
|
|
const profileName = getProfileName({
|
|
profile: init?.profile ?? callerClientConfig?.profile,
|
|
});
|
|
const profile = profiles[profileName];
|
|
if (!profile?.login_session) {
|
|
throw new CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
|
|
tryNextLink: true,
|
|
logger: init?.logger,
|
|
});
|
|
}
|
|
const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);
|
|
const credentials = await fetcher.loadCredentials();
|
|
return setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD");
|
|
};
|