修改: .env.template

修改:     app/api/auth.ts
	修改:     app/api/bedrock.ts
	修改:     app/client/api.ts
	修改:     app/client/platforms/bedrock.ts
	修改:     app/components/settings.tsx
	修改:     app/config/server.ts
	修改:     app/constant.t
This commit is contained in:
glay
2024-11-05 14:27:52 +08:00
parent 0f276f59bb
commit afbf5eb541
9 changed files with 184 additions and 153 deletions

View File

@@ -54,18 +54,18 @@ export function auth(req: NextRequest, modelProvider: ModelProvider) {
}
// Special handling for Bedrock
if (modelProvider === ModelProvider.Bedrock) {
const region = req.headers.get("X-Region");
const accessKeyId = req.headers.get("X-Access-Key");
const secretKey = req.headers.get("X-Secret-Key");
const region = serverConfig.awsRegion;
const accessKeyId = serverConfig.awsAccessKey;
const secretAccessKey = serverConfig.awsSecretKey;
console.log("[Auth] Bedrock credentials:", {
region,
accessKeyId: accessKeyId ? "***" : undefined,
secretKey: secretKey ? "***" : undefined,
secretKey: secretAccessKey ? "***" : undefined,
});
// Check if AWS credentials are provided
if (!region || !accessKeyId || !secretKey) {
if (!region || !accessKeyId || !secretAccessKey) {
return {
error: true,
msg: "Missing AWS credentials. Please configure Region, Access Key ID, and Secret Access Key in settings.",