mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: make social login optional
This commit is contained in:
1 parent
a79b66ed8d
commit
72b2711367
5 files changed
+145
-49
No files matched your search
@@ -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"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user