Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Gift List
Auth Condition
vtex.list
Version: 3.6.4
Latest version: 3.6.4

The auth-condition performs validation that the user is logged in to render different layouts.

{"base64":"  ","img":{"width":1416,"height":530,"type":"gif","mime":"image/gif","wUnits":"px","hUnits":"px","length":94691,"url":"https://user-images.githubusercontent.com/67066494/190255470-dda6e057-0a38-480c-8e10-31e6a93acca1.gif"}}

Configuration

  1. Import the vtex.list app to your theme's peer dependencies in the manifest.json file as in the following example:

_10
"peerDependencies": {
_10
"vtex.list": "3.x"
_10
}

  1. Add the auth-condition block for conditional validation in a template, like the one from home. For example:

_10
"store.home": {
_10
"blocks": [
_10
+ "auth-condition",
_10
]
_10
}

  1. Add the rendering condition you want by passing the blocks via props. For example:

_10
"auth-condition": {
_10
"props": {
_10
"Then": "flex-layout.row#home-with-user",
_10
"Else": "flex-layout.row#home-without-user"
_10
}
_10
}

Props

Prop NameTypeDescriptionDefault value
ThenblockName of the block to be rendered if the conditions are met.undefined
ElseblockName of the block to be rendered if the conditions are not met.undefined
See also
Vtex.list
VTEX IO Apps
VTEX App Store
VTEX IO Apps