Этот коммит содержится в:
Harrison Healey
2024-04-30 17:40:37 -04:00
коммит произвёл GitHub
родитель 43a5e61d85
Коммит 3bd6c44413

Просмотреть файл

@@ -8,8 +8,6 @@ import {FormattedMessage} from 'react-intl';
import {useDispatch} from 'react-redux'; import {useDispatch} from 'react-redux';
import {useHistory, useLocation} from 'react-router-dom'; import {useHistory, useLocation} from 'react-router-dom';
import type {UserProfile} from '@mattermost/types/users';
import {loginWithDesktopToken} from 'actions/views/login'; import {loginWithDesktopToken} from 'actions/views/login';
import DesktopApp from 'utils/desktop_api'; import DesktopApp from 'utils/desktop_api';
@@ -29,7 +27,7 @@ enum DesktopAuthStatus {
type Props = { type Props = {
href: string; href: string;
onLogin: (userProfile: UserProfile) => void; onLogin: () => void;
} }
const DesktopAuthToken: React.FC<Props> = ({href, onLogin}: Props) => { const DesktopAuthToken: React.FC<Props> = ({href, onLogin}: Props) => {
@@ -51,7 +49,7 @@ const DesktopAuthToken: React.FC<Props> = ({href, onLogin}: Props) => {
} }
sessionStorage.removeItem(DESKTOP_AUTH_PREFIX); sessionStorage.removeItem(DESKTOP_AUTH_PREFIX);
const {data: userProfile, error: loginError} = await dispatch(loginWithDesktopToken(serverToken)); const {error: loginError} = await dispatch(loginWithDesktopToken(serverToken));
if (loginError && loginError.server_error_id && loginError.server_error_id.length !== 0) { if (loginError && loginError.server_error_id && loginError.server_error_id.length !== 0) {
setStatus(DesktopAuthStatus.Error); setStatus(DesktopAuthStatus.Error);
@@ -59,7 +57,7 @@ const DesktopAuthToken: React.FC<Props> = ({href, onLogin}: Props) => {
} }
setStatus(DesktopAuthStatus.LoggedIn); setStatus(DesktopAuthStatus.LoggedIn);
await onLogin(userProfile as UserProfile); await onLogin();
}; };
const openExternalLoginURL = async () => { const openExternalLoginURL = async () => {