Skip to content

Commit

Permalink
MM-53148 Fix an incorrect type (mattermost#26920)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmhealey authored Apr 30, 2024
1 parent 43a5e61 commit 3bd6c44
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions webapp/channels/src/components/desktop_auth_token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {FormattedMessage} from 'react-intl';
import {useDispatch} from 'react-redux';
import {useHistory, useLocation} from 'react-router-dom';

import type {UserProfile} from '@mattermost/types/users';

import {loginWithDesktopToken} from 'actions/views/login';

import DesktopApp from 'utils/desktop_api';
Expand All @@ -29,7 +27,7 @@ enum DesktopAuthStatus {

type Props = {
href: string;
onLogin: (userProfile: UserProfile) => void;
onLogin: () => void;
}

const DesktopAuthToken: React.FC<Props> = ({href, onLogin}: Props) => {
Expand All @@ -51,15 +49,15 @@ const DesktopAuthToken: React.FC<Props> = ({href, onLogin}: Props) => {
}

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) {
setStatus(DesktopAuthStatus.Error);
return;
}

setStatus(DesktopAuthStatus.LoggedIn);
await onLogin(userProfile as UserProfile);
await onLogin();
};

const openExternalLoginURL = async () => {
Expand Down

0 comments on commit 3bd6c44

Please sign in to comment.