mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 10:07:35 +00:00
Try to handle logging in for graphql
This commit is contained in:
parent
d6fd46fc01
commit
72c8cf65dc
1 changed files with 8 additions and 1 deletions
|
|
@ -11,6 +11,9 @@ function warmScreenshotImage(hash) {
|
|||
|
||||
const mutation = gql`
|
||||
query GetSkinToReview {
|
||||
me {
|
||||
username
|
||||
}
|
||||
skin_to_review {
|
||||
filename
|
||||
md5
|
||||
|
|
@ -21,7 +24,11 @@ const mutation = gql`
|
|||
async function getSkinToReview() {
|
||||
if (USE_GRAPHQL) {
|
||||
const data = await Utils.fetchGraphql(mutation);
|
||||
return data.skin_to_review;
|
||||
if (data.me.username) {
|
||||
return data.skin_to_review;
|
||||
} else {
|
||||
window.location = `${API_URL}/auth`;
|
||||
}
|
||||
} else {
|
||||
const response = await fetch(
|
||||
`${API_URL}/to_review?cacheBust=${Math.random()}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue