Fondation
This commit is contained in:
parent
de64c10603
commit
d24f507daa
@ -73,7 +73,16 @@ export async function GET(request: Request) {
|
||||
}
|
||||
}
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_IFRAME_PAROLE_URL?.split('/channel')[0];
|
||||
// Extract base URL, removing any paths like /channel, /_oauth/connect, etc.
|
||||
let baseUrl = process.env.NEXT_PUBLIC_IFRAME_PAROLE_URL;
|
||||
if (baseUrl) {
|
||||
// Remove /channel and everything after
|
||||
baseUrl = baseUrl.split('/channel')[0];
|
||||
// Remove /_oauth/connect and everything after
|
||||
baseUrl = baseUrl.split('/_oauth')[0];
|
||||
// Remove trailing slashes
|
||||
baseUrl = baseUrl.replace(/\/+$/, '');
|
||||
}
|
||||
if (!baseUrl) {
|
||||
logger.error('[ROCKET_CHAT] Failed to get Rocket.Chat base URL');
|
||||
return NextResponse.json({ error: 'Server configuration error' }, { status: 500 });
|
||||
|
||||
@ -18,7 +18,16 @@ export async function GET(request: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_IFRAME_PAROLE_URL?.split('/channel')[0];
|
||||
// Extract base URL, removing any paths like /channel, /_oauth/connect, etc.
|
||||
let baseUrl = process.env.NEXT_PUBLIC_IFRAME_PAROLE_URL;
|
||||
if (baseUrl) {
|
||||
// Remove /channel and everything after
|
||||
baseUrl = baseUrl.split('/channel')[0];
|
||||
// Remove /_oauth/connect and everything after
|
||||
baseUrl = baseUrl.split('/_oauth')[0];
|
||||
// Remove trailing slashes
|
||||
baseUrl = baseUrl.replace(/\/+$/, '');
|
||||
}
|
||||
if (!baseUrl) {
|
||||
logger.error('[ROCKET_CHAT_USER_TOKEN] Failed to get Rocket.Chat base URL');
|
||||
return NextResponse.json(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user