|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
import { Button } from 'primereact/button';
|
|
|
import { Card } from 'primereact/card';
|
|
|
import { useNavigate } from 'react-router-dom';
|
|
|
-import { Auth, Configuration, Session } from '../services';
|
|
|
+import { Auth, Session } from '../services';
|
|
|
import { BackendReturnStatus } from '../types';
|
|
|
|
|
|
export const Login: React.FC = () => {
|
|
@@ -24,24 +24,12 @@ export const Login: React.FC = () => {
|
|
|
|
|
|
if (loading) return <></>;
|
|
|
|
|
|
- const redirectToVatsim = () => {
|
|
|
- const url = [
|
|
|
- Configuration.vatsim.authorizeUrl,
|
|
|
- `?client_id=${Configuration.vatsim.clientId}`,
|
|
|
- `&redirect_uri=${Configuration.resourceServer}/auth/vatsim`,
|
|
|
- `&response_type=code`,
|
|
|
- `&scope=full_name+vatsim_details`,
|
|
|
- `&approval_prompt=auto`,
|
|
|
- ].join('');
|
|
|
- window.location.replace(url);
|
|
|
- }
|
|
|
-
|
|
|
const footer = (
|
|
|
<span>
|
|
|
<Button
|
|
|
label='Login with VATSIM'
|
|
|
className='p-button'
|
|
|
- onClick={redirectToVatsim}
|
|
|
+ onClick={() => Auth.triggerLoginFlow()}
|
|
|
/>
|
|
|
</span>
|
|
|
);
|