@fishawack/lab-velocity 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div class="mt-2">
3
+ <p class="font-700 mb-0.5">Your password must contain:</p>
4
+ <p class="flex m-0">
5
+ <GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-7"
6
+ v-if="passwordLengthValid" />
7
+ <GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-3" v-else />
8
+ At least 8 characters
9
+ </p>
10
+ <p class="flex m-0">
11
+ <GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-7" v-if="hasLetter" />
12
+ <GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-3" v-else />
13
+ At least one letter
14
+ </p>
15
+ <p class="flex mt-0 ml-0 mr-0 mb-3">
16
+ <GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-7" v-if="hasNumberOrSymbol" />
17
+ <GSvg name="icon-list-tick" embed artboard class="mr-0.5 icon icon--0.4 fill-3" v-else />
18
+ At least one number or symbol
19
+ </p>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+
25
+ export default {
26
+ props: {
27
+ password: {
28
+ type: String,
29
+ default: '',
30
+ },
31
+ },
32
+ computed: {
33
+ passwordLengthValid() {
34
+ return this.password?.length >= 8;
35
+ },
36
+ hasLetter() {
37
+ return this.tests.letter.test(this.password);
38
+ },
39
+ hasNumberOrSymbol() {
40
+ return this.tests.number.test(this.password) || this.tests.symbol.test(this.password);
41
+ },
42
+ passwordValid() {
43
+ return this.passwordLengthValid && this.hasLetter && this.hasNumberOrSymbol;
44
+ },
45
+ },
46
+ data() {
47
+ return {
48
+ tests: {
49
+ letter: /[a-zA-Z]+/,
50
+ number: /[0-9]+/,
51
+ symbol: /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/,
52
+ }
53
+ };
54
+ },
55
+ watch: {
56
+ password(newPassword) {
57
+ this.$emit('passwordValid', this.passwordValid);
58
+ },
59
+ },
60
+ methods: {
61
+ },
62
+ mounted() {
63
+ this.$emit('passwordValid', this.passwordValid);
64
+ },
65
+ }
66
+ </script>
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ export function authRoutes(node, store, nested = 'auth') {
3
+ return {
4
+ path: '/'+nested,
5
+ name: nested,
6
+ component: require("../routes/container.vue").default,
7
+ redirect: (to) => {
8
+ return { name: `${nested}.login` };
9
+ },
10
+ children: [
11
+ {
12
+ path: "login-creds",
13
+ component: node
14
+ ? ""
15
+ : require("../routes/login.vue")
16
+ .default,
17
+ name: `${nested}.logincreds`
18
+ },
19
+ {
20
+ path: "login",
21
+ component: node
22
+ ? ""
23
+ : require("../routes/loginsso.vue")
24
+ .default,
25
+ name: `${nested}.login`
26
+ },
27
+ {
28
+ path: "callback",
29
+ component: node
30
+ ? ""
31
+ : require("../routes/logincallback.vue")
32
+ .default,
33
+ name: `${nested}.callback`
34
+ },
35
+ {
36
+ path: "forgot",
37
+ component: require("../routes/forgot.vue").default,
38
+ name: `${nested}.forgot`,
39
+ },
40
+ {
41
+ path: "reset",
42
+ component: require("../routes/reset.vue").default,
43
+ name: `${nested}.reset`,
44
+ props: true,
45
+ },
46
+ {
47
+ path: "force-reset",
48
+ component: require("../routes/force-reset.vue").default,
49
+ name: `${nested}.force-reset`,
50
+ props: true,
51
+ },
52
+ {
53
+ path: "register",
54
+ component: require("../routes/register.vue").default,
55
+ name: `${nested}.register`,
56
+ },
57
+ {
58
+ path: "verify",
59
+ component: require("../routes/verify.vue").default,
60
+ name: `${nested}.verify`,
61
+ },
62
+ {
63
+ path: "verified",
64
+ component: require("../routes/success-verify.vue").default,
65
+ name: `${nested}.success-verify`,
66
+ },
67
+ {
68
+ path: "expired-verification",
69
+ component: require("../routes/expired-verification.vue").default,
70
+ name: `${nested}.expired-verification`,
71
+ },
72
+ {
73
+ path: "expired-reset",
74
+ component: require("../routes/expired-reset.vue").default,
75
+ name: `${nested}.expired-reset`,
76
+ },
77
+ {
78
+ path: "success-reset",
79
+ component: require("../routes/success-reset.vue").default,
80
+ name: `${nested}.success-reset`,
81
+ },
82
+ {
83
+ path: "success-forgot",
84
+ component: require("../routes/success-forgot.vue").default,
85
+ name: `${nested}.success-forgot`,
86
+ },
87
+ {
88
+ path: "account-exists",
89
+ component: require("../routes/account-exists.vue").default,
90
+ name: `${nested}.account-exists`,
91
+ },
92
+ ],
93
+ props: true,
94
+ nav: {
95
+ visible: true,
96
+ },
97
+ meta: {
98
+ guest: true,
99
+ header: true,
100
+ footer: false,
101
+ fullpageModal: true,
102
+ },
103
+ }
104
+ }
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div class="relative">
3
+ <section id="resetPasswordForm">
4
+ <h1 class="h2">Account already exists</h1>
5
+
6
+ <p class="mt mb-0 color-21">
7
+ <strong class="">Company: {{ $route.query.company }}</strong>
8
+ </p>
9
+ <p class="mt-0.5">
10
+ Your company already has an active account.
11
+ </p>
12
+
13
+ <router-link
14
+ :to="{name: `${$store.state.authBase}.login`}"
15
+ class="button button--primary px-2"
16
+ >
17
+ <span v-text="'Sign in'" />
18
+ </router-link>
19
+ </section>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ metaInfo() {
26
+ return {
27
+ title: "Account Exists | Error",
28
+ };
29
+ },
30
+ };
31
+ </script>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div class="AuthModule">
3
+ <section class="AuthModule__Content">
4
+ <div class="AuthModule__logo__container">
5
+ <router-link to="/" class="logo" aria-label="Go to home page">
6
+ <GSvg
7
+ class="AuthModule__logo"
8
+ :name="logoName"
9
+ embed
10
+ asis
11
+ role="presentation"
12
+ tabindex="-1"
13
+ />
14
+ </router-link>
15
+ </div>
16
+ <div class="AuthModule__form">
17
+ <router-view />
18
+ </div>
19
+ </section>
20
+ <div class="pin right-0 bottom-0 mr-3">
21
+ </div>
22
+ </div>
23
+ </template>
24
+
25
+ <script>
26
+ export default {
27
+ mounted() {
28
+
29
+ },
30
+ data() {
31
+ return {
32
+ logoName: process.env.HYDRATE_LOGO,
33
+ }
34
+ },
35
+
36
+ components: {
37
+
38
+ },
39
+ };
40
+ </script>
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <h1 class="h2">Sorry, your password reset has expired</h1>
3
+
4
+ <p class="mt mb-0 color-21">
5
+ <strong class="">Email: {{ form?.email }}</strong>
6
+ </p>
7
+ <p class="mt-0.5">
8
+ For security, password reset requests are only <strong>active for 1&nbsp;hour</strong>. If you still want to reset your password, please request a new password reset-link.</p>
9
+
10
+ <form class="form"
11
+ @submit.prevent="submit"
12
+ >
13
+ <el-input
14
+ class="input--full mt-2 mb-2.5 hidden"
15
+ v-model="form.email"
16
+ label="Email address"
17
+ name="email"
18
+ :error="form.errors"
19
+ type="email"
20
+ placeholder="Email "
21
+ required
22
+ />
23
+ <button
24
+ type="submit"
25
+ :disabled="form.processing"
26
+ :loading="form.processing"
27
+ class="button button--primary"
28
+ >
29
+ Request new reset-link
30
+ </button>
31
+
32
+ <p class="disclaimer mt-2">
33
+ <router-link class="color-1 underline" :to="{ name: `${$store.state.authBase}.login` }">
34
+ Back to Sign in
35
+ </router-link>
36
+ </p>
37
+ </form>
38
+ </template>
39
+
40
+ <script>
41
+ import Form from "form-backend-validation";
42
+ import { default as elInput} from "../../form/basic.vue";
43
+
44
+ export default {
45
+ components: {
46
+ elInput: elInput,
47
+ },
48
+ data: () => ({
49
+ form: new Form(
50
+ {
51
+ email: "",
52
+ },
53
+ { resetOnSuccess: false }
54
+ ),
55
+ }),
56
+
57
+ methods: {
58
+ async submit() {
59
+ try {
60
+ await this.form.post("/forgot-password");
61
+
62
+ this.$router.push({
63
+ name: `${this.$store.state.authBase}.success-forgot`,
64
+ query: { email: this.form.email },
65
+ });
66
+ } catch (e) {
67
+ this.$root.errors(e);
68
+ }
69
+ },
70
+ },
71
+
72
+ mounted(){
73
+ this.form.email = this.$route.query.email;
74
+ }
75
+ };
76
+ </script>
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <h1 class="h2">Verification link expired</h1>
3
+
4
+ <form class="form" @submit.prevent="submit">
5
+ <p class="mt mb-0 color-21">
6
+ <strong class="">Email: {{ form?.email }}</strong>
7
+ </p>
8
+ <p class="mt-0.5">
9
+ This email verification link has expired. Not to worry, we can email you a new one.
10
+ </p>
11
+
12
+ <el-input
13
+ class="mt-2 mb-2.5 hidden"
14
+ v-model="form.email"
15
+ label="Email address"
16
+ name="email"
17
+ :error="form.errors"
18
+ type="email"
19
+ placeholder="Email "
20
+ required
21
+ />
22
+
23
+ <button
24
+ type="submit"
25
+ :disabled="form.processing"
26
+ :loading="form.processing"
27
+ class="button button--primary"
28
+ >
29
+ Re-send verification link
30
+ </button>
31
+ </form>
32
+
33
+ <p class="disclaimer mt-2">
34
+ Having trouble singing in?
35
+ <a :href="contact" class="underline">Contact us</a>
36
+ </p>
37
+ </template>
38
+
39
+ <script>
40
+ import Form from "form-backend-validation";
41
+ import { default as elInput} from "../../form/basic.vue";
42
+
43
+ export default {
44
+ components: {
45
+ elInput: elInput,
46
+ },
47
+ data: () => ({
48
+ form: new Form(
49
+ {
50
+ email: "",
51
+ },
52
+ { resetOnSuccess: false }
53
+ ),
54
+ notification: null,
55
+ contact: process.env.HYDRATE_CONTACT ?? 'mailto:EP@avalerehealth.com',
56
+ }),
57
+
58
+ methods: {
59
+ async submit() {
60
+ try {
61
+ if (this.notification) {
62
+ this.notification.close();
63
+ this.notification = null;
64
+ }
65
+
66
+ await this.form.post("/email/verification-notification");
67
+
68
+ this.$notify.success({
69
+ message: "Email has been re-sent",
70
+ duration: 10000,
71
+ class: 'el-notification--success el-notification--right-override'
72
+ });
73
+ } catch (e) {
74
+ if (e.response && e.response.status === 429) {
75
+ this.notification = this.$notify({
76
+ type: "warning",
77
+ message: 'Please allow 10 minutes before re-requesting',
78
+ duration: 0,
79
+ class: 'el-notification--warning el-notification--right-override'
80
+ });
81
+ } else if (e.response && e.response.status === 422) {
82
+ this.notification = this.$notify({
83
+ type: "error",
84
+ message: e.response.data.message,
85
+ duration: 0,
86
+ class: 'el-notification--error el-notification--right-override'
87
+ });
88
+ }
89
+ else {
90
+ this.$root.errors(e);
91
+ }
92
+ }
93
+ },
94
+ },
95
+
96
+ async mounted() {
97
+ this.form.email = this.$route.query.email;
98
+ },
99
+ };
100
+ </script>
@@ -0,0 +1,132 @@
1
+ <template>
2
+ <div class="relative">
3
+ <section id="resetPasswordForm">
4
+ <h1 class="h2">Welcome</h1>
5
+ <form class="form" @submit.prevent="submit">
6
+ <div v-if="!form.successful">
7
+ <p class="mt mb-0 color-21">
8
+ <strong class="">Email: {{ $store.state.user?.email }}</strong>
9
+ </p>
10
+ <p class="mt-0.5">
11
+ <strong>Hello {{ $store.state.user?.name }}</strong>, and welcome to Policy 360. To maintain security, anyone signing in with a one-time-password must <strong>create a new password</strong> the first time they access the Policy 360 portal.
12
+ </p>
13
+ <el-input
14
+ v-model="form.password"
15
+ class="mt-2"
16
+ label="New Password"
17
+ placeholder="Enter new password"
18
+ name="password"
19
+ :error="form.errors"
20
+ type="password"
21
+ autocomplete="new-password"
22
+ required
23
+ />
24
+
25
+ <VPasswordValidation :password="form.password" @passwordValid="updatePasswordValidity" />
26
+
27
+ <button
28
+ type="submit"
29
+ :disabled="form.processing || !isPasswordValid"
30
+ :loading="form.processing"
31
+ class="button button--primary mt-1.5"
32
+ >
33
+ <span v-text="'Update password'" />
34
+ </button>
35
+ </div>
36
+ <div v-else>
37
+ <h4 class="mt" v-text="`Success!`" />
38
+ <strong class="">Email: {{ user?.email }}</strong>
39
+ <p v-text="`Your password has been updated.`" />
40
+ <p class="disclaimer mb-2.5">
41
+ <router-link
42
+ class="color-1 underline"
43
+ :to="{ name: `${$store.state.authBase}.login` }"
44
+ >
45
+ Continue
46
+ </router-link>
47
+ </p>
48
+ </div>
49
+ </form>
50
+ </section>
51
+ </div>
52
+ </template>
53
+
54
+ <script>
55
+ import Form from "form-backend-validation";
56
+ import { default as elInput} from "../../form/basic.vue";
57
+
58
+ export default {
59
+ data() {
60
+ return {
61
+ form: new Form(
62
+ {
63
+ email: this.$store.state.user?.email,
64
+ password: '',
65
+ },
66
+ { resetOnSuccess: false }
67
+ ),
68
+ isPasswordValid: false,
69
+ };
70
+ },
71
+
72
+ mounted() {
73
+
74
+ this.$store.dispatch("getUser", {
75
+ errors: this.$root.errors,
76
+ });
77
+ },
78
+
79
+ methods: {
80
+ async submit() {
81
+ this.loading = true;
82
+
83
+ try {
84
+ await this.form.put('/user/password');
85
+ await this.login();
86
+ } catch (e) {
87
+ this.$root.errors(e);
88
+ } finally {
89
+ this.loading = false;
90
+ }
91
+ },
92
+ async login() {
93
+ this.loading = true;
94
+
95
+ try {
96
+ const res = await this.form.post("/login");
97
+
98
+ if(res['logged-in']){
99
+ try{
100
+ await this.$store.dispatch("logout", {
101
+ errors: this.$root.errors,
102
+ });
103
+ } catch(e){}
104
+
105
+ await this.form.post("/login");
106
+ }
107
+ this.$router.push({name: `${this.$store.state.authBase}.callback`,query: {authenticated: true}});
108
+
109
+ } catch (e) {
110
+ this.$root.errors(e);
111
+ } finally {
112
+ this.loading = false;
113
+ }
114
+ },
115
+
116
+ updatePasswordValidity(isValid) {
117
+ this.isPasswordValid = isValid;
118
+ },
119
+ },
120
+
121
+ metaInfo() {
122
+ return {
123
+ title: "Reset Password",
124
+ };
125
+ },
126
+
127
+ components: {
128
+ VPasswordValidation: require("./../components/VPasswordValidation.vue").default,
129
+ elInput: elInput,
130
+ },
131
+ };
132
+ </script>
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <div class="relative">
3
+ <section id="forgotPasswordForm">
4
+ <h1 class="h2">Reset password</h1>
5
+ <form class="form" @submit.prevent="submit">
6
+ <p class="mt-0.5">
7
+ Enter the email address associated with your account to continue.
8
+ </p>
9
+
10
+ <el-input
11
+ v-if="!form.successful"
12
+ class="mt-2 mb-2.5"
13
+ v-model="form.email"
14
+ label="Email "
15
+ placeholder="Enter email address"
16
+ name="email"
17
+ :error="form.errors"
18
+ type="email"
19
+ required
20
+ />
21
+
22
+ <button
23
+ type="submit"
24
+ :disabled="form.processing || !form.email || form.email?.length < 5"
25
+ :loading="form.processing"
26
+ class="button button--primary"
27
+ >
28
+ Continue
29
+ </button>
30
+
31
+ <p class="disclaimer mt-2">
32
+ <router-link
33
+ class="color-1 underline"
34
+ :to="{ name: `${$store.state.authBase}.login` }"
35
+ >
36
+ Back to Sign in
37
+ </router-link>
38
+ </p>
39
+ </form>
40
+ </section>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ import Form from "form-backend-validation";
46
+ import { default as elInput} from "../../form/basic.vue";
47
+
48
+ export default {
49
+ components: {
50
+ elInput:elInput,
51
+ },
52
+
53
+ data: () => ({
54
+ form: new Form(
55
+ {
56
+ email: "",
57
+ },
58
+ { resetOnSuccess: false }
59
+ ),
60
+ }),
61
+
62
+ methods: {
63
+ async submit() {
64
+ try {
65
+ await this.form.post("/forgot-password");
66
+
67
+ this.$router.push({
68
+ name: `${this.$store.state.authBase}.success-forgot`,
69
+ query: { email: this.form.email },
70
+ });
71
+ } catch (e) {
72
+ this.$root.errors(e);
73
+ }
74
+ },
75
+ },
76
+
77
+ mounted() {
78
+ this.form.email = this.$route.query.email;
79
+ },
80
+
81
+ metaInfo() {
82
+ return {
83
+ title: "Forgot Password",
84
+ };
85
+ },
86
+ };
87
+ </script>