Additional resources
Before installing any forms complete the following steps:
To add the form to your Vue project, first install @userfront/toolkit
with npm.
npm install @userfront/toolkit
Initialize the Userfront UI Toolkit for Vue with your workspace ID using Userfront.init()
.
You can do this in the main file (as shown here) or in a component file. If you do this in the main file, you only need to do it once.
// main.js
import Vue from "vue";import Userfront from "@userfront/toolkit/vue";import App from "./App.vue";
Userfront.init("demo1234");
new Vue({ render: (h) => h(App)}).$mount("#app");
You can add as many forms as you would like across your application.
To have a working application ensure you have the following forms at their associated paths:
Form name | Redirect path name |
---|---|
Login form | After-logout path |
Password reset form | Password reset path |
The signup form will:
Install by copying the code below and pasting it in your application.
<!-- App.vue -->
<template> <div id="app"> <signup-form /> </div></template>
<script></script><style></style>
See a demo on CodeSandbox
The login form will:
lastActiveAt
attributeTo handle login links correctly put a login form at your After-logout path.
Install by copying the code below and pasting it in your application.
<!-- App.vue -->
<template> <div id="app"> <login-form /> </div></template>
<script></script><style></style>
The password reset form will:
To handle password resets correctly put a password reset form at your Password reset path.
Install by copying the code below and pasting it in your application.
<!-- App.vue -->
<template> <div id="app"> <password-reset-form /> </div></template>
<script></script><style></style>
The logout button will:
Install by copying the code below and pasting it in your application.
<!-- App.vue -->
<template> <div id="app"> <logout-button /> </div></template>
<script></script><style></style>