Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Overview

Basic components












Gift List
Auth Condition

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://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-list-authcondition-0.gif"}}

Configuration

  1. Import the vtex.list app to your theme's peer dependencies in the manifest.json file as in the following example:
"peerDependencies": { "vtex.list": "3.x" }
  1. Add the auth-condition block for conditional validation in a template, like the one from home. For example:
"store.home": { "blocks": [ + "auth-condition", ] }
  1. Add the rendering condition you want by passing the blocks via props. For example:
"auth-condition": { "props": { "Then": "flex-layout.row#home-with-user", "Else": "flex-layout.row#home-without-user" } }

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
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Go Back To List
Add To List Button
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page