Fix a bug where you are logged out after reloading the /create page
This commit is contained in:
parent
9525aa68d5
commit
2e93076d79
|
|
@ -1,13 +1,18 @@
|
|||
import App, { Container } from 'next/app';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import Notifications from 'react-notify-toast';
|
||||
import Favicon from 'react-favicon';
|
||||
import App, { Container } from 'next/app';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import Notifications from 'react-notify-toast';
|
||||
import Favicon from 'react-favicon';
|
||||
|
||||
import withReduxStore from '../js/redux/reduxStoreBinder';
|
||||
import withReduxStore from '../js/redux/reduxStoreBinder';
|
||||
import { verifyCredentials } from '../js/api.js';
|
||||
|
||||
class TurniereApp extends App {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render () {
|
||||
const {Component, pageProps, reduxStore} = this.props;
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -21,19 +21,12 @@ import { Footer } from '../js/components/Footer';
|
|||
import { UserRestrictor, Option } from '../js/components/UserRestrictor';
|
||||
import { Login } from '../js/components/Login';
|
||||
import EditableStringList from '../js/components/EditableStringList';
|
||||
import {
|
||||
verifyCredentials,
|
||||
createTournament
|
||||
} from '../js/api';
|
||||
import { createTournament } from '../js/api';
|
||||
|
||||
import '../static/everypage.css';
|
||||
|
||||
class PrivateCreatePage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isSignedIn } = this.props;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { Col, Container, Row } from 'reactstrap';
|
|||
import { TurniereNavigation } from '../js/components/Navigation';
|
||||
import { BigImage } from '../js/components/BigImage';
|
||||
import { Footer } from '../js/components/Footer';
|
||||
import { verifyCredentials } from '../js/api';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
|
||||
|
|
@ -224,10 +223,6 @@ function TournamentFaq() {
|
|||
|
||||
export default class FaqPage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { Container } from 'reactstrap';
|
|||
import { TurniereNavigation } from '../js/components/Navigation';
|
||||
import { BigImage } from '../js/components/BigImage';
|
||||
import { Footer } from '../js/components/Footer';
|
||||
import { verifyCredentials } from '../js/api';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import '../static/everypage.css';
|
||||
|
|
@ -76,10 +75,6 @@ function ImprintText(){
|
|||
|
||||
export default class ImprintPage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@ import {
|
|||
import { TurniereNavigation } from '../js/components/Navigation';
|
||||
import { BigImage } from '../js/components/BigImage';
|
||||
import { Footer } from '../js/components/Footer';
|
||||
import {
|
||||
verifyCredentials
|
||||
} from '../js/api';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
|
||||
|
|
@ -174,10 +171,6 @@ function PromotedLinkCreateTournament() {
|
|||
|
||||
class Index extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -10,17 +10,12 @@ import { TurniereNavigation } from '../js/components/Navigation';
|
|||
import { Footer } from '../js/components/Footer';
|
||||
import {
|
||||
getRequest,
|
||||
getState,
|
||||
verifyCredentials
|
||||
getState
|
||||
} from '../js/api';
|
||||
|
||||
import '../static/everypage.css';
|
||||
|
||||
export default class ListPage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -4,16 +4,11 @@ import React from 'react';
|
|||
import { TurniereNavigation } from '../js/components/Navigation';
|
||||
import { Footer } from '../js/components/Footer';
|
||||
import { Login } from '../js/components/Login';
|
||||
import { verifyCredentials } from '../js/api';
|
||||
|
||||
import '../static/everypage.css';
|
||||
|
||||
export default class LoginPage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="main generic-fullpage-bg">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { Container } from 'reactstrap';
|
|||
import { TurniereNavigation } from '../js/components/Navigation';
|
||||
import { BigImage } from '../js/components/BigImage';
|
||||
import { Footer } from '../js/components/Footer';
|
||||
import { verifyCredentials } from '../js/api';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
|
||||
|
|
@ -496,10 +495,6 @@ function PrivacyText(){
|
|||
|
||||
export default class PrivacyPage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -16,16 +16,11 @@ import {
|
|||
import { TurniereNavigation } from '../js/components/Navigation';
|
||||
import { Footer } from '../js/components/Footer';
|
||||
import { register } from '../js/api';
|
||||
import { verifyCredentials } from '../js/api';
|
||||
|
||||
import '../static/everypage.css';
|
||||
|
||||
export default class RegisterPage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="main generic-fullpage-bg">
|
||||
|
|
|
|||
|
|
@ -17,10 +17,7 @@ import { UserRestrictor, Option } from '../js/components/UserRestrictor';
|
|||
import { Footer } from '../js/components/Footer';
|
||||
import { Login } from '../js/components/Login';
|
||||
import { ErrorPageComponent } from '../js/components/ErrorComponents';
|
||||
import {
|
||||
verifyCredentials,
|
||||
updateTeamName
|
||||
} from '../js/api';
|
||||
import { updateTeamName } from '../js/api';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
|
||||
|
|
@ -42,7 +39,6 @@ class EditTournamentPage extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
requestTournament(this.props.query.code, () => {
|
||||
this.setState({ validCode: true });
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,11 @@
|
|||
import Head from 'next/head';
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
verifyCredentials
|
||||
} from '../js/api';
|
||||
|
||||
class FullscreenTournamentPage extends React.Component {
|
||||
|
||||
static async getInitialProps({query}) {
|
||||
return {query};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ import { TurniereNavigation } from '../js/components/Navigation';
|
|||
import { BigImage } from '../js/components/BigImage';
|
||||
import {
|
||||
getRequest,
|
||||
getState,
|
||||
verifyCredentials
|
||||
getState
|
||||
} from '../js/api';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
|
|
@ -387,8 +386,6 @@ class Main extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
verifyCredentials();
|
||||
|
||||
const code = this.props.query.code;
|
||||
|
||||
getRequest(getState(), '/tournaments/' + code)
|
||||
|
|
|
|||
Loading…
Reference in New Issue