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';
|
|
|
|
import Helmet from 'react-helmet';
|
2019-12-08 00:32:00 +05:30
|
|
|
import loader from 'app/services/loader';
|
|
|
|
import { Query } from 'app/services/request';
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
import rootMessages from '../root/RootPage.intl.json';
|
2017-08-08 01:41:39 +05:30
|
|
|
import styles from './success-oauth.scss';
|
2017-08-06 05:14:35 +05:30
|
|
|
import messages from './SuccessOauthPage.intl.json';
|
|
|
|
|
2019-12-07 16:58:52 +05:30
|
|
|
export default class SuccessOauthPage extends React.Component<{
|
2019-11-27 14:33:32 +05:30
|
|
|
location: {
|
2019-12-07 16:58:52 +05:30
|
|
|
query: Query<'appName'>;
|
|
|
|
};
|
2017-08-23 02:01:41 +05:30
|
|
|
}> {
|
2019-11-27 14:33:32 +05:30
|
|
|
componentDidMount() {
|
|
|
|
this.onPageUpdate();
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
setTimeout(() => {
|
|
|
|
try {
|
|
|
|
// try to close window if possible
|
2019-12-07 16:58:52 +05:30
|
|
|
// @ts-ignore
|
2019-11-27 14:33:32 +05:30
|
|
|
window.open('', '_self').close();
|
|
|
|
} catch (err) {
|
|
|
|
// don't care
|
|
|
|
}
|
|
|
|
}, 8000);
|
|
|
|
}
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
componentDidUpdate() {
|
|
|
|
this.onPageUpdate();
|
|
|
|
}
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
onPageUpdate() {
|
|
|
|
loader.hide();
|
|
|
|
}
|
2017-08-08 01:41:39 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
render() {
|
|
|
|
const appName = this.props.location.query.get('appName');
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
return (
|
|
|
|
<div className={styles.page}>
|
|
|
|
<Message {...messages.title}>
|
|
|
|
{pageTitle => <Helmet title={pageTitle} />}
|
|
|
|
</Message>
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
<div className={styles.wrapper}>
|
|
|
|
<Link to="/" className={styles.logo}>
|
|
|
|
<Message {...rootMessages.siteName} />
|
|
|
|
</Link>
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
<div className={styles.title}>
|
|
|
|
<Message {...messages.applicationAuth} />
|
|
|
|
</div>
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
<div className={styles.checkmark} />
|
2017-08-06 05:14:35 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
<div className={styles.description}>
|
|
|
|
{appName ? (
|
|
|
|
<Message
|
|
|
|
{...messages.authorizationForAppSuccessful}
|
|
|
|
values={{
|
|
|
|
appName: <b>{appName}</b>,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
<Message {...messages.authorizationSuccessful} />
|
|
|
|
)}
|
|
|
|
|
|
|
|
<Message {...messages.youCanCloseThisPage} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-08-06 05:14:35 +05:30
|
|
|
}
|