Skip to content
Snippets Groups Projects
Commit 619f15b9 authored by Björn Modée's avatar Björn Modée
Browse files

Add comments

parent 8b3dc7e8
No related branches found
No related tags found
No related merge requests found
Pipeline #46731 passed with warnings
This diff is collapsed.
/** Utility component to use for authentication*/
import React from 'react' import React from 'react'
import { Redirect, Route, RouteProps } from 'react-router-dom' import { Redirect, Route, RouteProps } from 'react-router-dom'
import { useAppSelector } from '../hooks' import { useAppSelector } from '../hooks'
...@@ -10,7 +12,7 @@ interface SecureRouteProps extends RouteProps { ...@@ -10,7 +12,7 @@ interface SecureRouteProps extends RouteProps {
authLevel: 'admin' | 'login' | 'Operator' | 'Team' | 'Judge' | 'Audience' authLevel: 'admin' | 'login' | 'Operator' | 'Team' | 'Judge' | 'Audience'
} }
/** Utility component to use for authentication, replace all routes that should be private with secure routes*/ /** replace all routes that should be private with secure routes */
const SecureRoute: React.FC<SecureRouteProps> = ({ component: Component, authLevel, ...rest }: SecureRouteProps) => { const SecureRoute: React.FC<SecureRouteProps> = ({ component: Component, authLevel, ...rest }: SecureRouteProps) => {
const userAuthenticated = useAppSelector((state) => state.user.authenticated) const userAuthenticated = useAppSelector((state) => state.user.authenticated)
const compAuthenticated = useAppSelector((state) => state.competitionLogin.authenticated) const compAuthenticated = useAppSelector((state) => state.competitionLogin.authenticated)
......
/** This file contains the funtion to check if Admin is authenticated */
import axios from 'axios' import axios from 'axios'
import jwtDecode from 'jwt-decode' import jwtDecode from 'jwt-decode'
import Types from '../actions/types' import Types from '../actions/types'
......
/** This file contains the funtion to check if authenticated
* when logging in with a code generated from competition
*/
import axios from 'axios' import axios from 'axios'
import jwtDecode from 'jwt-decode' import jwtDecode from 'jwt-decode'
import { logoutCompetition } from '../actions/competitionLogin' import { logoutCompetition } from '../actions/competitionLogin'
......
/** Change the icon depending on what type of question the slide has */
import BuildOutlinedIcon from '@material-ui/icons/BuildOutlined' import BuildOutlinedIcon from '@material-ui/icons/BuildOutlined'
import CheckBoxOutlinedIcon from '@material-ui/icons/CheckBoxOutlined' import CheckBoxOutlinedIcon from '@material-ui/icons/CheckBoxOutlined'
import CreateOutlinedIcon from '@material-ui/icons/CreateOutlined' import CreateOutlinedIcon from '@material-ui/icons/CreateOutlined'
......
/** Handles the uploading of a picture to a competition */
import axios from 'axios' import axios from 'axios'
import { getEditorCompetition } from '../actions/editor' import { getEditorCompetition } from '../actions/editor'
import { Media } from '../interfaces/ApiModels' import { Media } from '../interfaces/ApiModels'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment