@@ -151,39 +170,28 @@ const Login = () => {
>
{title === 'login' ? t('login') : t('continue')}
- {title === 'login' && (
- <>
- {/*
*/}
- {location.host === Domain && (
+ {title === 'login' && channels && channels.length > 0 && (
+
+ {channels.map((item) => (
- )}
- >
+ ))}
+
)}
diff --git a/web/src/services/user-service.ts b/web/src/services/user-service.ts
index d6f5f920a..1177f34af 100644
--- a/web/src/services/user-service.ts
+++ b/web/src/services/user-service.ts
@@ -123,6 +123,10 @@ const methods = {
const userService = registerServer
(methods, request);
+export const getLoginChannels = () => request.get(api.login_channels);
+export const loginWithChannel = (channel: string) =>
+ (window.location.href = api.login_channel(channel));
+
export const listTenantUser = (tenantId: string) =>
request.get(api.listTenantUser(tenantId));
diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts
index e9eff866a..e83e5109d 100644
--- a/web/src/utils/api.ts
+++ b/web/src/utils/api.ts
@@ -11,6 +11,8 @@ export default {
user_info: `${api_host}/user/info`,
tenant_info: `${api_host}/user/tenant_info`,
set_tenant_info: `${api_host}/user/set_tenant_info`,
+ login_channels: `${api_host}/user/login/channels`,
+ login_channel: (channel: string) => `${api_host}/user/login/${channel}`,
// team
addTenantUser: (tenantId: string) => `${api_host}/tenant/${tenantId}/user`,