2019-12-07 16:58:52 +05:30
|
|
|
import React from 'react';
|
2017-08-06 05:14:35 +05:30
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
2019-12-30 12:59:39 +05:30
|
|
|
import { Helmet } from 'react-helmet-async';
|
2020-01-18 02:07:52 +05:30
|
|
|
import * as loader from 'app/services/loader';
|
2019-12-08 00:32:00 +05:30
|
|
|
import { Query } from 'app/services/request';
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2020-06-04 22:11:27 +05:30
|
|
|
import siteName from 'app/pages/root/siteName.intl';
|
2017-08-08 01:41:39 +05:30
|
|
|
import styles from './success-oauth.scss';
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2019-12-07 16:58:52 +05:30
|
|
|
export default class SuccessOauthPage extends React.Component<{
|
2020-05-24 04:38:24 +05:30
|
|
|
location: {
|
|
|
|
query: Query<'appName'>;
|
|
|
|
};
|
2017-08-23 02:01:41 +05:30
|
|
|
}> {
|
2020-05-24 04:38:24 +05:30
|
|
|
componentDidMount() {
|
|
|
|
this.onPageUpdate();
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
setTimeout(() => {
|
|
|
|
try {
|
|
|
|
// try to close window if possible
|
|
|
|
// @ts-ignore
|
|
|
|
window.open('', '_self').close();
|
|
|
|
} catch (err) {
|
|
|
|
// don't care
|
|
|
|
}
|
|
|
|
}, 8000);
|
|
|
|
}
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
componentDidUpdate() {
|
|
|
|
this.onPageUpdate();
|
|
|
|
}
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
onPageUpdate() {
|
|
|
|
loader.hide();
|
|
|
|
}
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
render() {
|
|
|
|
const appName = this.props.location.query.get('appName');
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
return (
|
|
|
|
<div className={styles.page}>
|
2020-06-04 22:11:27 +05:30
|
|
|
<Message key="title" defaultMessage="Authorization successful">
|
|
|
|
{(pageTitle) => <Helmet title={pageTitle as string} />}
|
|
|
|
</Message>
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
<div className={styles.wrapper}>
|
|
|
|
<Link to="/" className={styles.logo}>
|
2020-06-04 22:11:27 +05:30
|
|
|
<Message {...siteName} />
|
2020-05-24 04:38:24 +05:30
|
|
|
</Link>
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
<div className={styles.title}>
|
2020-06-04 22:11:27 +05:30
|
|
|
<Message key="applicationAuth" defaultMessage="Application authorization" />
|
2020-05-24 04:38:24 +05:30
|
|
|
</div>
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
<div className={styles.checkmark} />
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
<div className={styles.description}>
|
|
|
|
{appName ? (
|
|
|
|
<Message
|
2020-06-04 22:11:27 +05:30
|
|
|
key="authorizationForAppSuccessful"
|
|
|
|
defaultMessage="Authorization for {appName} has been successfully completed."
|
2020-05-24 04:38:24 +05:30
|
|
|
values={{
|
|
|
|
appName: <b>{appName}</b>,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
) : (
|
2020-06-04 22:11:27 +05:30
|
|
|
<Message
|
|
|
|
key="authorizationSuccessful"
|
|
|
|
defaultMessage="Authorization has been successfully completed."
|
|
|
|
/>
|
2020-05-24 04:38:24 +05:30
|
|
|
)}
|
|
|
|
|
2020-06-04 22:11:27 +05:30
|
|
|
<Message
|
|
|
|
key="youCanCloseThisPage"
|
|
|
|
defaultMessage="You can close this window and return to your application."
|
|
|
|
/>
|
2020-05-24 04:38:24 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-08-06 05:14:35 +05:30
|
|
|
}
|