Fix trailing whitespace in API Key
This commit is contained in:
parent
4680a34884
commit
e4636991a7
@ -46,7 +46,7 @@ export async function createSessionClient() {
|
||||
// Soporte para bypass de administrador (Emergencia/Dev)
|
||||
if (sessionCookie.value === "admin-bypass-session") {
|
||||
// Escalamos a privilegios de API Key para el bypass
|
||||
client.setKey(process.env.APPWRITE_API_KEY || '');
|
||||
client.setKey((process.env.APPWRITE_API_KEY || '').trim());
|
||||
} else {
|
||||
client.setSession(sessionCookie.value);
|
||||
}
|
||||
@ -67,9 +67,12 @@ export async function createAdminClient() {
|
||||
const client = new Client()
|
||||
.setEndpoint(ENDPOINT)
|
||||
.setProject(PROJECT_ID)
|
||||
.setKey(process.env.APPWRITE_API_KEY || '');
|
||||
.setKey((process.env.APPWRITE_API_KEY || '').trim());
|
||||
|
||||
patchClientInstance(client);
|
||||
|
||||
const keyPrefix = process.env.APPWRITE_API_KEY ? process.env.APPWRITE_API_KEY.trim().substring(0, 15) + '...' : 'EMPTY_KEY';
|
||||
console.log('Admin Client initialized with key:', keyPrefix, 'Length:', process.env.APPWRITE_API_KEY?.length);
|
||||
|
||||
return {
|
||||
get account() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user