Skip to content

Commit

Permalink
Logout page. Ajusted headers on proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyzen committed Oct 3, 2021
1 parent 3a05d11 commit d668362
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
21 changes: 21 additions & 0 deletions components/LoadingIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
<stop stop-color="#4B5563" stop-opacity="0" offset="0%" />
<stop stop-color="#4B5563" stop-opacity=".631" offset="63.146%" />
<stop stop-color="#4B5563" offset="100%" />
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<g transform="translate(1 1)">
<path d="M36 18c0-9.94-8.06-18-18-18" id="Oval-2" stroke="url(#a)" stroke-width="2">
<animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.9s" repeatCount="indefinite" />
</path>
<circle fill="#fff" cx="36" cy="18" r="1">
<animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.9s" repeatCount="indefinite" />
</circle>
</g>
</g>
</svg>
</template>
5 changes: 4 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
[[redirects]]
from = "/*"
to = "https://testing.2cubedtest.com/:splat"
status = 200
status = 200
force = true
headers = {Access-Control-Allow-Origin = "*", Access-Control-Allow-Headers = "Content-Type, *", Access-Control-Allow-Methods = "GET, POST", Access-Control-Allow-Credentials= "true"}

14 changes: 5 additions & 9 deletions pages/logout.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<div class="container flex items-center justify-center min-h-[300px] text-2xl">
<h2 v-if="hasLoggedOut">You have been successfully logged out.</h2>
<h2 v-else>Something went wrong. Please try again</h2>
<LoadingIcon v-if="hasLoggedOut == null" />
<h2 v-if="hasLoggedOut == true">You have been successfully logged out.</h2>
<h2 v-if="hasLoggedOut == false">Something went wrong. Please try again</h2>
</div>
</template>

Expand All @@ -11,7 +12,7 @@ import { gql } from 'nuxt-graphql-request'
export default {
data() {
return {
hasLoggedOut: false
hasLoggedOut: null
}
},
methods: {
Expand All @@ -24,12 +25,7 @@ export default {
}
`
const { logout } = await this.$graphql.default.request(query)
// SUCCESS
if (logout.status == 'SUCCESS') {
this.hasLoggedOut = true
}
console.log(logout.status)
this.hasLoggedOut = logout.status == 'SUCCESS' ? true : false
}
},
mounted() {
Expand Down

0 comments on commit d668362

Please sign in to comment.