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