Skip to main content

<SignOutButton />

You're reading Identity & Access Management 7.1.0. The newest release is 7.3.0, and Cloud has the newest features. Go to the newest release

The SignOutButton component renders a button that signs the user out using the WSO2 Identity Server Vue SDK (@asgardeo/vue).

Overview​

When clicked, SignOutButton calls signOut(). The SDK clears the session in the app and redirects the user to WSO2 Identity Server to end their session there. WSO2 Identity Server then redirects the user to the afterSignOutUrl set on <AsgardeoProvider>.

Usage​

The following examples show how to use SignOutButton.

Basic usage​

Place the button where only signed-in users see it, for example inside <SignedIn>.

SignOutButton example
<script setup>
import { SignedIn, SignOutButton } from '@asgardeo/vue'
</script>

<template>
<SignedIn>
<SignOutButton />
</SignedIn>
</template>

Without slot content, the button shows the elements.buttons.signout.text translation of the current language ("Sign Out" in English).

Custom content​

Put your own content in the default slot. The slot receives isLoading, which is true while sign-out is in progress.

Custom content
<template>
<SignOutButton v-slot="{ isLoading }">
{{ isLoading ? 'Signing out...' : 'Log out' }}
</SignOutButton>
</template>

Props​

SignOutButton has no props.

Slots​

SlotSlot propsDescription
default{ isLoading: boolean }Content of the button. Defaults to the elements.buttons.signout.text translation.

Events​

EventPayloadDescription
clickMouseEventEmitted when the button is clicked, before signOut() starts.
errorunknownEmitted when sign-out fails.

Styling​

The button has the CSS class asgardeo-sign-out-button. Add your own classes with the class attribute.

Was this page helpful?