mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
fix: display block only when social logins enabled
* text-m -> text-base
This commit is contained in:
1 parent
50bed23d37
commit
6654f8880a
1 file changed
+11
-2
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { login, register } from '../utils/auth'
|
import { login, register } from '../utils/auth'
|
||||||
import api from '../utils/api'
|
import api from '../utils/api'
|
||||||
@@ -19,6 +19,13 @@ onMounted(async () => {
|
|||||||
availableMethods.value = res.data
|
availableMethods.value = res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const hasSocialLogins = computed(() => {
|
||||||
|
// There is any key other than 'local' is true
|
||||||
|
return Object.keys(availableMethods.value).some(
|
||||||
|
(method) => method !== 'local' && availableMethods.value[method]
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
const success = () => {
|
const success = () => {
|
||||||
router.push({ name: 'game' })
|
router.push({ name: 'game' })
|
||||||
}
|
}
|
||||||
@@ -172,8 +179,9 @@ const goBack = () => {
|
|||||||
>
|
>
|
||||||
<span>Back to Login</span>
|
<span>Back to Login</span>
|
||||||
</button>
|
</button>
|
||||||
|
<div v-if="hasSocialLogins">
|
||||||
<hr class="my-8" />
|
<hr class="my-8" />
|
||||||
<p class="flex justify-center font-semibold text-text text-m">
|
<p class="flex justify-center font-semibold text-text text-base">
|
||||||
Log in with social account
|
Log in with social account
|
||||||
</p>
|
</p>
|
||||||
<a
|
<a
|
||||||
@@ -183,6 +191,7 @@ const goBack = () => {
|
|||||||
>
|
>
|
||||||
<span>Google</span>
|
<span>Google</span>
|
||||||
</a>
|
</a>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
Reference in new issue
Block a user