Skip to main content

<AsgardeoSignOutButton />

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

<AsgardeoSignOutButton> renders a button that signs the user out with the WSO2 Identity Server Nuxt SDK (@asgardeo/nuxt).

Overview​

When the user clicks the button, it calls useAsgardeo().signOut(), which:

  1. Sends a POST request to /api/auth/signout.
  2. The server clears the session cookies and returns the WSO2 Identity Server sign-out URL.
  3. The browser navigates to that URL. WSO2 Identity Server ends the session and redirects the user to afterSignOutUrl.

If the user has no valid session, or the server can't build the sign-out URL, the server still clears the cookies and the browser navigates to afterSignOutUrl directly.

Usage​

The component is auto-registered, so you don't need to import it.

Basic usage​

<template>
<AsgardeoSignedIn>
<AsgardeoSignOutButton />
</AsgardeoSignedIn>
</template>

Without slot content, the button shows the text Sign Out.

Custom content​

<template>
<AsgardeoSignOutButton class="btn btn-secondary">
<template #default="{ isLoading }">
{{ isLoading ? 'Signing out…' : 'Log out' }}
</template>
</AsgardeoSignOutButton>
</template>

Props​

<AsgardeoSignOutButton> has no props. The class and style attributes are applied to the button.

Slots​

SlotSlot propsDescription
default{ isLoading: boolean }Button content. Defaults to Sign Out.

Events​

EventPayloadDescription
clickMouseEventEmitted after sign-out starts the navigation.
errorunknownEmitted when sign-out fails.

Was this page helpful?