mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 01:46:07 +00:00
fix: bug in bind space account in models dialog
This commit is contained in:
@@ -206,8 +206,23 @@ export default function ModelsDialog({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSpaceLogin() {
|
async function handleSpaceLogin() {
|
||||||
window.location.href = '/auth/space';
|
try {
|
||||||
|
const token = localStorage.getItem('token');
|
||||||
|
if (!token) {
|
||||||
|
toast.error(t('common.error'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const currentOrigin = window.location.origin;
|
||||||
|
const redirectUri = `${currentOrigin}/auth/space/callback?mode=bind`;
|
||||||
|
const response = await httpClient.getSpaceAuthorizeUrl(
|
||||||
|
redirectUri,
|
||||||
|
token,
|
||||||
|
);
|
||||||
|
window.location.href = response.authorize_url;
|
||||||
|
} catch {
|
||||||
|
toast.error(t('common.spaceLoginFailed'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleAddModel(
|
async function handleAddModel(
|
||||||
|
|||||||
Reference in New Issue
Block a user