Skip to main content

<ThunderIDUser />

The ThunderIDUser component provides access to the authenticated user object via a scoped slot. It is auto-registered by the Nuxt module.

Usage

Basic Usage

pages/profile.vue
<template>
<ThunderIDUser>
<template #default="{ user }">
<div v-if="user">
<h1>Welcome, {{ user.displayName }}!</h1>
<p>{{ user.email }}</p>
</div>
</template>
</ThunderIDUser>
</template>

With a Fallback

Show alternative content when no user is signed in:

pages/profile.vue
<template>
<ThunderIDUser>
<template #default="{ user }">
<h1>{{ user.displayName }}</h1>
</template>
<template #fallback>
<p>Please sign in to view your profile.</p>
</template>
</ThunderIDUser>
</template>

Slots

SlotSlot PropsDescription
default{ user: User | null }Receives the authenticated user object
fallbackRendered when no user is signed in

User Slot Prop

PropertyTypeDescription
substringThe user's unique subject identifier
displayNamestring | nullThe user's display name
emailstring | nullThe user's email address
firstNamestring | nullThe user's first name
lastNamestring | nullThe user's last name
profileUrlstring | nullURL to the user's profile picture
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy