Updated dependencies, addressed #33
This commit is contained in:
@@ -24,10 +24,7 @@ const Account = props => {
|
|||||||
//grab the user's info
|
//grab the user's info
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
||||||
method: 'GET',
|
method: 'GET'
|
||||||
headers: {
|
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.then(blob => blob.json())
|
.then(blob => blob.json())
|
||||||
.then(json => contactRef.current.checked = json.contact)
|
.then(json => contactRef.current.checked = json.contact)
|
||||||
@@ -88,7 +85,6 @@ const update = async (password, retype, contact, tokenFetch) => {
|
|||||||
const result = await tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
const result = await tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ const handleSubmit = async (email, password) => {
|
|||||||
const result = await fetch(`${process.env.AUTH_URI}/auth/login`, {
|
const result = await fetch(`${process.env.AUTH_URI}/auth/login`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
email,
|
email,
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ const handleSubmit = async (password, authTokens) => {
|
|||||||
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/account`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -54,7 +53,6 @@ const handleSubmit = async (password, authTokens) => {
|
|||||||
const result2 = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/logout`, {
|
const result2 = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/logout`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ const Logout = () => {
|
|||||||
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/logout`, { //NOTE: this gets overwritten as a bugfix
|
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/auth/logout`, { //NOTE: this gets overwritten as a bugfix
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: authTokens.refreshToken
|
token: authTokens.refreshToken
|
||||||
|
|||||||
@@ -66,8 +66,7 @@ const handleSubmit = async (email) => {
|
|||||||
const result = await fetch(`${process.env.AUTH_URI}/auth/recover`, {
|
const result = await fetch(`${process.env.AUTH_URI}/auth/recover`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
email
|
email
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ const update = async (password, retype, query) => {
|
|||||||
const result = await fetch(`${process.env.AUTH_URI}/auth/reset?email=${query.email}&token=${query.token}`, {
|
const result = await fetch(`${process.env.AUTH_URI}/auth/reset?email=${query.email}&token=${query.token}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ const handleSubmit = async (email, username, password, retype, contact) => {
|
|||||||
const result = await fetch(`${process.env.AUTH_URI}/auth/signup`, {
|
const result = await fetch(`${process.env.AUTH_URI}/auth/signup`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
email,
|
email,
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ const handleButtonPress = async (username, tokenFetch) => {
|
|||||||
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/banuser`, {
|
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/banuser`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
username
|
username
|
||||||
|
|||||||
@@ -8,12 +8,7 @@ const ChatReports = props => {
|
|||||||
const authTokens = useContext(TokenContext);
|
const authTokens = useContext(TokenContext);
|
||||||
|
|
||||||
useEffect(async () => {
|
useEffect(async () => {
|
||||||
const result = await authTokens.tokenFetch(`${process.env.CHAT_URI}/admin/reports`, {
|
const result = await authTokens.tokenFetch(`${process.env.CHAT_URI}/admin/reports`);
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!result.ok) {
|
if (!result.ok) {
|
||||||
const err = `${result.status}: ${await result.text()}`;
|
const err = `${result.status}: ${await result.text()}`;
|
||||||
@@ -59,8 +54,7 @@ const deleteReportsFor = (chatlogIndex, tokenFetch, setReports) => {
|
|||||||
tokenFetch(`${process.env.CHAT_URI}/admin/reports`, {
|
tokenFetch(`${process.env.CHAT_URI}/admin/reports`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ chatlogIndex })
|
body: JSON.stringify({ chatlogIndex })
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ const handleButtonPress = async (username, tokenFetch, method) => {
|
|||||||
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/admin`, {
|
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/admin`, {
|
||||||
method: method,
|
method: method,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
username
|
username
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ const handleButtonPress = async (username, tokenFetch, method) => {
|
|||||||
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/mod`, {
|
const result = await tokenFetch(`${process.env.AUTH_URI}/admin/mod`, {
|
||||||
method: method,
|
method: method,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
username
|
username
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ const NewsEditor = props => {
|
|||||||
const result = await fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`, {
|
const result = await fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -42,11 +41,7 @@ const NewsEditor = props => {
|
|||||||
options={articles.map(article => { return { label: article.title, index: article.index }; })}
|
options={articles.map(article => { return { label: article.title, index: article.index }; })}
|
||||||
onChange={async ({index}) => {
|
onChange={async ({index}) => {
|
||||||
//fetch this article
|
//fetch this article
|
||||||
const result = await fetch(`${process.env.NEWS_URI}/news/archive/${index}`, {
|
const result = await fetch(`${process.env.NEWS_URI}/news/archive/${index}`);
|
||||||
headers: {
|
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!result.ok) {
|
if (!result.ok) {
|
||||||
const err = `${result.status}: ${await result.text()}`;
|
const err = `${result.status}: ${await result.text()}`;
|
||||||
@@ -107,8 +102,7 @@ const handleSubmit = async (title, author, body, index, tokenFetch) => {
|
|||||||
const result = await tokenFetch(`${process.env.NEWS_URI}/news/${index}`, {
|
const result = await tokenFetch(`${process.env.NEWS_URI}/news/${index}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
title,
|
title,
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ const handleSubmit = async (title, author, body, tokenFetch) => {
|
|||||||
{
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
title,
|
title,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const Break = () => {
|
|||||||
const Footer = () => {
|
const Footer = () => {
|
||||||
return (
|
return (
|
||||||
<footer>
|
<footer>
|
||||||
<p className='text centered'>© <a href='https://krgamestudios.com'>KR Game Studios</a> 2020-2021<Break /><Link to='/privacypolicy'>Privacy Policy</Link><Break /><Link to='/credits'>Credits</Link></p>
|
<p className='text centered'>© <a href='https://krgamestudios.com'>KR Game Studios</a> 2020-2022<Break /><Link to='/privacypolicy'>Privacy Policy</Link><Break /><Link to='/credits'>Credits</Link></p>
|
||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ const NewsFeed = props => {
|
|||||||
fetch(`${process.env.NEWS_URI}/news`, {
|
fetch(`${process.env.NEWS_URI}/news`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
signal: aborter.current.signal //oh dear
|
signal: aborter.current.signal //oh dear
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ const Static = props => {
|
|||||||
</header>
|
</header>
|
||||||
<h2>MERN-template</h2>
|
<h2>MERN-template</h2>
|
||||||
<p>The <a href='https://github.com/krgamestudios/MERN-template'>MERN-template</a> developed by Kayne Ruse, KR Game Studios</p>
|
<p>The <a href='https://github.com/krgamestudios/MERN-template'>MERN-template</a> developed by Kayne Ruse, KR Game Studios</p>
|
||||||
<br />
|
|
||||||
<p>Additional programming by Keith "prox" Campbell</p>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ const TokenProvider = props => {
|
|||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Authorization': `Bearer ${bearer}`
|
'Authorization': `Bearer ${bearer}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -50,8 +49,7 @@ const TokenProvider = props => {
|
|||||||
const response = await fetch(`${process.env.AUTH_URI}/auth/token`, {
|
const response = await fetch(`${process.env.AUTH_URI}/auth/token`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: refreshToken
|
token: refreshToken
|
||||||
@@ -91,8 +89,7 @@ const TokenProvider = props => {
|
|||||||
const response = await fetch(`${process.env.AUTH_URI}/auth/token`, {
|
const response = await fetch(`${process.env.AUTH_URI}/auth/token`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json'
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: refreshToken
|
token: refreshToken
|
||||||
|
|||||||
Generated
+2406
-2733
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user