Before we can begin to render the Corbado Authentication UI, the Corbado.load() call has to resolve. Find more here.

Integration

The Authentication UI allows the user to log in or register with Corbado. The UI is rendered by using the Corbado.mountAuthUI method. Once the user is logged in, the onLoggedIn callback is executed.

Auth.vue
<script setup lang="ts">
import Corbado from '@corbado/web-js'
import { inject, type Ref, ref, watchEffect } from 'vue'

// Inject the global state
const isCorbadoLoaded = inject('isCorbadoLoaded') as Ref<boolean>
const authElement = ref<HTMLDivElement>()

watchEffect(() => {
    if (isCorbadoLoaded.value && authElement.value) {
        // mount auth UI as soon as Corbado is loaded
        Corbado.mountAuthUI(authElement.value, {
            onLoggedIn: () => {
                console.log('User logged in')
                // perform any action after the user logs in (e.g. redirect to another page)
            }
        })
    }
})
</script>

<template>
    <div ref="authElement"></div>
</template>

Customize Styling and Translations

Corbado UI Components can be customized to match your application’s design and language preferences. You can adjust the styling and translations of the components to create a seamless user experience:

Next

Let your users manage their passkeys with the PasskeyList.