feat: make social login optional

This commit is contained in:
Lin, Hung-Shin committed 2023-10-05 13:32:02 +08:00
1 parent a79b66ed8d
commit 72b2711367
5 files changed
+145 -49

No files matched your search

+8 -1
View File
@@ -1,5 +1,5 @@
<script setup>
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { login, register } from '../utils/auth'
import api from '../utils/api'
@@ -13,6 +13,12 @@ const emailInput = ref(null)
const password = ref('')
const errorMessage = ref('')
const availableMethods = ref({})
onMounted(async () => {
const res = await api.get('/auth/available-methods')
availableMethods.value = res.data
})
const success = () => {
router.push({ name: 'game' })
}
@@ -172,6 +178,7 @@ const goBack = () => {
Log in with social account
</p>
<a
v-if="availableMethods.google"
class="inline-flex justify-center rounded-lg text-sm font-black py-2 mt-3 bg-icon-google text-text w-full"
href="/api/v1/auth/google"
>