Skip to content

Commit edbb6b4

Browse files
committed
Create RequestPassword.vue and ResetPassword.vue forms
1 parent fafd347 commit edbb6b4

File tree

4 files changed

+98
-7
lines changed

4 files changed

+98
-7
lines changed

backend/src/router/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {createRouter, createWebHistory} from "vue-router";
22
import Login from "../views/Login.vue";
33
import Dashboard from "../views/Dashboard.vue";
4+
import RequestPassword from "../views/RequestPassword.vue";
5+
import ResetPassword from "../views/ResetPassword.vue";
46

57
const routes = [
68
{
@@ -12,6 +14,16 @@ const routes = [
1214
path: '/login',
1315
name: 'login',
1416
component: Login
17+
},
18+
{
19+
path: '/request-password',
20+
name: 'requestPassword',
21+
component: RequestPassword
22+
},
23+
{
24+
path: '/reset-password/:token',
25+
name: 'resetPassword',
26+
component: ResetPassword
1527
}
1628
];
1729

backend/src/views/Login.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
<div class="min-h-full flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
33
<div class="max-w-md w-full space-y-8">
44
<div>
5-
<img class="mx-auto h-12 w-auto" src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" alt="Workflow" />
65
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">Sign in to your account</h2>
7-
<p class="mt-2 text-center text-sm text-gray-600">
8-
Or
9-
{{ ' ' }}
10-
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500"> start your 14-day free trial </a>
11-
</p>
126
</div>
137
<form class="mt-8 space-y-6" action="#" method="POST">
148
<input type="hidden" name="remember" value="true" />
@@ -30,7 +24,7 @@
3024
</div>
3125

3226
<div class="text-sm">
33-
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500"> Forgot your password? </a>
27+
<router-link :to="{name: 'requestPassword'}" class="font-medium text-indigo-600 hover:text-indigo-500"> Forgot your password? </router-link>
3428
</div>
3529
</div>
3630

backend/src/views/RequestPassword.vue

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<div class="min-h-full flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
3+
<div class="max-w-md w-full space-y-8">
4+
<div>
5+
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">Request new password</h2>
6+
</div>
7+
<form class="mt-8 space-y-6" action="#" method="POST">
8+
<input type="hidden" name="remember" value="true" />
9+
<div class="rounded-md shadow-sm -space-y-px">
10+
<div>
11+
<label for="email-address" class="sr-only">Email address</label>
12+
<input id="email-address" name="email" type="email" autocomplete="email" required="" class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm" placeholder="Email address" />
13+
</div>
14+
</div>
15+
16+
<div class="flex items-center justify-between">
17+
<div class="text-sm">
18+
<router-link :to="{name: 'login'}" class="font-medium text-indigo-600 hover:text-indigo-500"> Remember your password? </router-link>
19+
</div>
20+
</div>
21+
22+
<div>
23+
<button type="submit" class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
24+
<span class="absolute left-0 inset-y-0 flex items-center pl-3">
25+
<LockClosedIcon class="h-5 w-5 text-indigo-500 group-hover:text-indigo-400" aria-hidden="true" />
26+
</span>
27+
Submit
28+
</button>
29+
</div>
30+
</form>
31+
</div>
32+
</div>
33+
</template>
34+
35+
<script setup>
36+
import { LockClosedIcon } from '@heroicons/vue/solid'
37+
</script>

backend/src/views/ResetPassword.vue

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<template>
2+
<div class="min-h-full flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
3+
<div class="max-w-md w-full space-y-8">
4+
<div>
5+
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">Set new password</h2>
6+
</div>
7+
<form class="mt-8 space-y-6" action="#" method="POST">
8+
<input type="hidden" name="remember" value="true"/>
9+
<div class="rounded-md shadow-sm -space-y-px">
10+
<div>
11+
<label for="new-password" class="sr-only">New Password</label>
12+
<input id="new-password" name="password" type="password" required=""
13+
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
14+
placeholder="New Password"/>
15+
</div>
16+
<div>
17+
<label for="password-repeat" class="sr-only">Repeat Password</label>
18+
<input id="password-repeat" name="password_repeat" type="password" required=""
19+
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
20+
placeholder="Repeat Password"/>
21+
</div>
22+
</div>
23+
24+
<div class="flex items-center justify-between">
25+
<div class="text-sm">
26+
<router-link :to="{name: 'login'}" class="font-medium text-indigo-600 hover:text-indigo-500">
27+
Go back to Login
28+
</router-link>
29+
</div>
30+
</div>
31+
32+
<div>
33+
<button type="submit"
34+
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
35+
<span class="absolute left-0 inset-y-0 flex items-center pl-3">
36+
<LockClosedIcon class="h-5 w-5 text-indigo-500 group-hover:text-indigo-400" aria-hidden="true"/>
37+
</span>
38+
Submit
39+
</button>
40+
</div>
41+
</form>
42+
</div>
43+
</div>
44+
</template>
45+
46+
<script setup>
47+
import {LockClosedIcon} from '@heroicons/vue/solid'
48+
</script>

0 commit comments

Comments
 (0)