mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-05 11:06:07 +00:00
d64278ab3f
* feat(cloud): provision workspace model catalog * ci(cloud): pin model catalog adapter source * fix: make cloud model catalog sync recoverable * ci: pin cloud adapter source for release --------- Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
25 lines
899 B
JavaScript
25 lines
899 B
JavaScript
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
import test from 'node:test';
|
|
|
|
const source = fs.readFileSync(
|
|
new URL('../../src/app/auth/space/callback/page.tsx', import.meta.url),
|
|
'utf8',
|
|
);
|
|
|
|
test('direct launch assertion is fragment-only and removed before exchange', () => {
|
|
assert.doesNotMatch(source, /searchParams\.get\(['"]launch_assertion['"]\)/);
|
|
const readIndex = source.indexOf("fragmentParams.get('launch_assertion')");
|
|
const clearIndex = source.indexOf('window.history.replaceState');
|
|
const exchangeIndex = source.indexOf('handleOAuthCallback(', clearIndex);
|
|
assert.ok(readIndex >= 0, 'fragment assertion read is missing');
|
|
assert.ok(
|
|
clearIndex > readIndex,
|
|
'URL fragment is not cleared after copying the assertion',
|
|
);
|
|
assert.ok(
|
|
exchangeIndex > clearIndex,
|
|
'assertion exchange starts before the fragment is cleared',
|
|
);
|
|
});
|