Sending cookies with fetch, bg color change

This commit is contained in:
MrFry 2020-04-08 18:12:20 +02:00
parent 9f576a41f6
commit cbba4cd616
10 changed files with 21 additions and 11 deletions

View file

@ -1,5 +1,5 @@
{
"apiUrl": "http://api.frylabs.net/",
"apiUrl": "https://api.frylabs.net/",
"mobileWindowWidth": 700,
"maxQuestionsToRender": 250
}

View file

@ -1,7 +1,7 @@
:root {
--text-color: #9999ff;
--bright-color: #f2f2f2;
--background-color: #212127;
--background-color: #222426;
--hoover-color: #202020;
}
@ -28,7 +28,7 @@ a {
margin: 0;
padding: 0;
width: 200px;
background-color: #212127;
background-color: #222426;
position: fixed;
height: 100%;
overflow: auto;

View file

@ -10,7 +10,7 @@ class MyDocument extends Document {
return (
<Html>
<Head />
<body bgcolor='#212127'>
<body bgcolor='#222426'>
<Main />
<NextScript />
</body>

View file

@ -12,7 +12,9 @@ export default function AllQuestions (props) {
const [searchTerm, setSearchTerm] = useState('')
useEffect(() => {
fetch(`${constants.apiUrl}data.json`)
fetch(`${constants.apiUrl}data.json`, {
credentials: 'include'
})
.then((resp) => {
return resp.json()
})

View file

@ -1,7 +1,7 @@
.searchBar {
margin: 10px;
color: white;
background-color: #212127;
background-color: #222426;
border: none;
font-size: 18px;
flex-grow: 1;

View file

@ -73,6 +73,7 @@ export default function Feedback (props) {
const rawResponse = await fetch(constants.apiUrl + 'postfeedback', {
method: 'POST',
credentials: 'include',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@ -102,6 +103,7 @@ export default function Feedback (props) {
const rawFileResponse = await fetch(constants.apiUrl + 'postfeedbackfile', {
method: 'POST',
credentials: 'include',
headers: {
'Accept': 'application/json'
},

View file

@ -16,7 +16,9 @@ export default function Index (props) {
useEffect(() => {
console.info('Fetching news.json')
fetch(`${constants.apiUrl}news.json`) // eslint-disable-line
fetch(`${constants.apiUrl}news.json`, {
credentials: 'include'
})
.then((resp) => {
return resp.json()
})
@ -27,7 +29,9 @@ export default function Index (props) {
useEffect(() => {
console.info('Fetching data')
fetch(`${constants.apiUrl}motd`)
fetch(`${constants.apiUrl}motd`, {
credentials: 'include'
})
.then((resp) => {
return resp.text()
})

View file

@ -18,7 +18,9 @@ export default function SubjectBrowser (props) {
useEffect(() => {
console.info('Fetching data')
fetch(`${constants.apiUrl}data.json`)
fetch(`${constants.apiUrl}data.json`, {
credentials: 'include'
})
.then((resp) => {
return resp.json()
})

View file

@ -1,7 +1,7 @@
.searchBar {
margin: 10px;
color: white;
background-color: #212127;
background-color: #222426;
border: none;
font-size: 18px;
flex-grow: 1;

View file

@ -8,7 +8,7 @@
<style>
:root{
--size: 100px;
--bgcolor: #212127;
--bgcolor: #222426;
--color: #fcff4f;
--shadow: rgba(30,2,5,.2);
}