mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-04 00:27:14 +00:00
b44b8f474d
* fix(cloud): provision login workspace just in time * fix(oauth): send callback URI during code exchange * fix(oauth): preserve callback URI through browser exchange * fix(oauth): negotiate redirect-bound codes --------- Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
20 lines
692 B
JavaScript
20 lines
692 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/login/page.tsx', import.meta.url),
|
|
'utf8',
|
|
);
|
|
|
|
test('normal Cloud login uses the standard Space OAuth callback path', () => {
|
|
assert.doesNotMatch(source, /cloudEntry/);
|
|
assert.match(source, /getSpaceAuthorizeUrl\(redirectUri\)/);
|
|
});
|
|
|
|
test('invitation login uses the same OAuth callback before accepting the invitation', () => {
|
|
assert.doesNotMatch(source, /cloudEntry/);
|
|
assert.match(source, /const invitationToken = getPendingInvitationToken\(\)/);
|
|
assert.match(source, /acceptWorkspaceInvitation\(invitationToken\)/);
|
|
});
|