fix(auth): trim opencode server username
This commit is contained in:
@@ -73,7 +73,7 @@ function generateSecureOpenCodePassword(): string {
|
||||
}
|
||||
|
||||
function buildOpenCodeAuthHeader(password: string): string {
|
||||
const username = process.env.OPENCODE_SERVER_USERNAME || 'opencode';
|
||||
const username = process.env.OPENCODE_SERVER_USERNAME?.trim() || 'opencode';
|
||||
return `Basic ${Buffer.from(`${username}:${password}`, 'utf8').toString('base64')}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export const createOpenCodeAuthStateRuntime = (dependencies) => {
|
||||
return {};
|
||||
}
|
||||
|
||||
const username = process.env.OPENCODE_SERVER_USERNAME || 'opencode';
|
||||
const username = process.env.OPENCODE_SERVER_USERNAME?.trim() || 'opencode';
|
||||
const credentials = Buffer.from(`${username}:${password}`).toString('base64');
|
||||
return { Authorization: `Basic ${credentials}` };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user