Skip to content

Instantly share code, notes, and snippets.

@armenr
Created August 2, 2021 19:43
Show Gist options
  • Save armenr/38f653af3c8c625bdb11ebc0ba1b96f2 to your computer and use it in GitHub Desktop.
Save armenr/38f653af3c8c625bdb11ebc0ba1b96f2 to your computer and use it in GitHub Desktop.
auth-component formFields fix
<script setup lang="ts">
const isLoggedIn = false
const authFormFields = [
{
type: 'email',
required: true,
},
{
type: 'password',
required: true,
},
{
type: 'given_name',
label: 'First name',
placeholder: 'First name',
name: 'given_name',
required: true,
},
{
type: 'family_name',
label: 'Family name',
placeholder: 'Last name',
name: 'family_name',
required: true,
},
{
type: 'phone_number',
label: 'Phone Number',
placeholder: 'Ex: +1(425)555-1212',
name: 'phone_number',
required: true,
},
]
</script>
<template>
<!--eslint-disable vue/attribute-hyphenation ! -->
<!--eslint-disable vue/no-deprecated-slot-attribute ! -->
<amplify-authenticator
v-if="isLoggedIn === false"
validation-errors=""
>
<amplify-sign-up
slot="sign-up"
header-text="BEPOS"
username-alias="email"
:formFields="authFormFields"
/>
<amplify-totp-setup slot="totp-setup">
</amplify-totp-setup>
<amplify-sign-out></amplify-sign-out>
</amplify-authenticator>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment