Anson Geisel
03/06/2026, 8:44 PMDevRev
03/06/2026, 8:45 PMonLogout callback prop on the UserProfile widget to handle logout events, including after password resets.
<template>
<UserProfile
widgetId="user-profile-widget"
:onLogout="handleLogout"
/>
</template>
<script setup>
import { UserProfile } from '@descope/vue-sdk'
import { useDescope } from '@descope/vue-sdk'
import { useRouter } from 'vue-router'
const { logout } = useDescope()
const router = useRouter()
const handleLogout = async () => {
await logout()
router.push('/login')
}
</script>
Alternative Approach
You can also use the SDK's logout function directly and redirect programmatically:
<script setup>
import { useDescope } from '@descope/vue-sdk'
const { logout } = useDescope()
const forceLogout = async () => {
await logout()
window.location.href = '/login'
}
</script>
⢠The onLogout callback fires when users log out from the profile widget
⢠Use useDescope().logout() to programmatically log out users
User Widgets | Descope Documentation
Vue.js & Ruby Quickstart | Descope Documentation