@sowell/quasar-app-extension-auth 0.4.10 → 0.5.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.
- package/.github/workflows/publish.yml +1 -1
- package/.github/workflows/remove-stale-branches.yml +19 -0
- package/README.md +8 -27
- package/package.json +4 -4
- package/src/boot/store.ts +0 -2
- package/src/components/pages/Auth.vue +4 -3
- package/src/components/pages/AuthReporter.vue +9 -8
- package/src/components/pages/OtpValidation.vue +6 -8
- package/src/components/pages/ResetPassword.vue +3 -3
- package/src/components/pages/WebResetPassword.vue +4 -3
- package/src/injects/index.ts +0 -1
- package/src/injects/prompts.ts +1 -6
- package/src/interfaces/Boot.ts +0 -2
- package/src/prompts.js +0 -42
- package/.github/workflows/main.yml +0 -22
- package/src/injects/store.ts +0 -10
- package/src/store/index.ts +0 -71
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Remove stale branches
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: "0 0 * * *" # Everday at midnight
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
remove-stale-branches:
|
|
10
|
+
name: Remove Stale Branches
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: fpicalausa/remove-stale-branches@v1.6.0
|
|
14
|
+
with:
|
|
15
|
+
dry-run: false # Check out the console output before setting this to false
|
|
16
|
+
days-before-branch-stale: 180
|
|
17
|
+
days-before-branch-delete: 0
|
|
18
|
+
operations-per-run: 50
|
|
19
|
+
exempt-authors-regex: "^dependabot"
|
package/README.md
CHANGED
|
@@ -53,28 +53,6 @@ The default is /users/passwords
|
|
|
53
53
|
|
|
54
54
|
The default is Bearer but you can change it according to your needs
|
|
55
55
|
|
|
56
|
-
10. Vuex mutation to set token
|
|
57
|
-
|
|
58
|
-
The default is auth/setToken in the auth module.
|
|
59
|
-
It can be changed from the moment it takes the token in parameter
|
|
60
|
-
|
|
61
|
-
11. Vuex mutation to clear token and all user state
|
|
62
|
-
|
|
63
|
-
The default is auth/clearToken in the auth module but can be changed
|
|
64
|
-
|
|
65
|
-
12. Vuex mutation to set user information when resetting password (email or phone number)
|
|
66
|
-
|
|
67
|
-
The default is auth/setInfosUser in auth module.
|
|
68
|
-
It takes email or phone number, can be changed
|
|
69
|
-
|
|
70
|
-
13. Vuex getter to return token
|
|
71
|
-
|
|
72
|
-
The default is auth/getToken and return token, can be changed.
|
|
73
|
-
|
|
74
|
-
14. Vuex getter to return user information
|
|
75
|
-
|
|
76
|
-
The default is auth/getInfosUser and return email or phone number
|
|
77
|
-
|
|
78
56
|
# Uninstall
|
|
79
57
|
|
|
80
58
|
```bash
|
|
@@ -173,8 +151,11 @@ Launch test E2E with Continuous integration mode and cypress test all file in di
|
|
|
173
151
|
```
|
|
174
152
|
|
|
175
153
|
# netlify-plugin-cypress
|
|
154
|
+
|
|
176
155
|
[](https://circleci.com/gh/cypress-io/netlify-plugin-cypress/tree/master) [![renovate-app badge][renovate-badge]][renovate-app] [](https://dashboard.cypress.io/projects/ixroqc/runs) [](https://app.netlify.com/sites/sad-lumiere-6a00a5/deploys)
|
|
156
|
+
|
|
177
157
|
> Runs Cypress end-to-end tests on Netlify Build
|
|
158
|
+
|
|
178
159
|
## Install and use
|
|
179
160
|
|
|
180
161
|
You can install this plugin in the Netlify UI from this [direct in-app installation link](https://app.netlify.com/plugins/netlify-plugin-cypress/install) or from the [Plugins directory](https://app.netlify.com/plugins).
|
|
@@ -189,8 +170,7 @@ yarn add -D netlify-plugin-cypress
|
|
|
189
170
|
|
|
190
171
|
And then add the plugin's name to the list of build plugins in `netlify.toml` file as shown in the examples below.
|
|
191
172
|
|
|
192
|
-
|
|
193
|
-
|
|
173
|
+
_note:_ this plugin assumes you have already installed Cypress as a dev NPM dependency.
|
|
194
174
|
|
|
195
175
|
## How does it work
|
|
196
176
|
|
|
@@ -488,9 +468,10 @@ public/
|
|
|
488
468
|
The `public` folder is served automatically and the following test successfully visits both the root and the `about.html` pages:
|
|
489
469
|
|
|
490
470
|
```js
|
|
491
|
-
cy.visit(
|
|
492
|
-
cy.visit(
|
|
471
|
+
cy.visit("/");
|
|
472
|
+
cy.visit("/pages/about"); // visits the about.html
|
|
493
473
|
```
|
|
474
|
+
|
|
494
475
|
**Warning:** be careful with verbose logging, since it can print all environment variables passed to the plugin, including tokens, API keys, and other secrets.
|
|
495
476
|
|
|
496
477
|
Error: error:0308010C:digital envelope routines::unsupported
|
|
@@ -502,4 +483,4 @@ If you appreciate the work that went into this App Extension, make donation to [
|
|
|
502
483
|
|
|
503
484
|
# License
|
|
504
485
|
|
|
505
|
-
MIT (c) Sowell
|
|
486
|
+
MIT (c) Sowell
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sowell/quasar-app-extension-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A Quasar app extension to manage Authentication",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": "https://github.com/sowell-ai/quasar.extension.auth",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"yarn": ">= 1.6.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@quasar/cli": "^
|
|
24
|
+
"@quasar/cli": "^2.2.3",
|
|
25
25
|
"@quasar/quasar-app-extension-testing-e2e-cypress": "^3.1.0",
|
|
26
26
|
"@types/node": "^16.9.1",
|
|
27
27
|
"@types/validator": "^13.6.3",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"eslint-plugin-vue": "^7.0.0",
|
|
33
33
|
"jwt-decode": "^3.1.2",
|
|
34
34
|
"quasar": "^2.6.2",
|
|
35
|
+
"vue": "3.4.21",
|
|
35
36
|
"typescript": "^4.4.2"
|
|
36
37
|
},
|
|
37
38
|
"directories": {
|
|
@@ -45,7 +46,6 @@
|
|
|
45
46
|
"pinia": "^2.0.12",
|
|
46
47
|
"qs": "^6.10.1",
|
|
47
48
|
"validator": "^13.6.0",
|
|
48
|
-
"vue-router": "^4.0.0"
|
|
49
|
-
"vuex": "4.0"
|
|
49
|
+
"vue-router": "^4.0.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/boot/store.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
//@ts-ignore
|
|
2
2
|
import { boot } from "quasar/wrappers";
|
|
3
3
|
import { BootInterface } from "../interfaces";
|
|
4
|
-
import tokenModule from "../store";
|
|
5
4
|
|
|
6
5
|
export default boot(({ app, store }: BootInterface) => {
|
|
7
6
|
// Register store module
|
|
8
|
-
store.registerModule("token", tokenModule);
|
|
9
7
|
app.provide("$store", store);
|
|
10
8
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-layout>
|
|
3
|
-
<
|
|
2
|
+
<q-layout class="column justify-end items-center q-pb-lg">
|
|
3
|
+
<div>
|
|
4
4
|
<div class="q-pa-lg">
|
|
5
5
|
<div class="column justify-center items-center">
|
|
6
6
|
<div class="row justify-center">
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
/>
|
|
158
158
|
</q-dialog>
|
|
159
159
|
</div>
|
|
160
|
-
</
|
|
160
|
+
</div>
|
|
161
161
|
<q-footer class="footer">
|
|
162
162
|
<q-toolbar>
|
|
163
163
|
<q-toolbar-title>
|
|
@@ -264,3 +264,4 @@ export default defineComponent({
|
|
|
264
264
|
background: transparent;
|
|
265
265
|
}
|
|
266
266
|
</style>
|
|
267
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-layout>
|
|
3
|
-
<
|
|
2
|
+
<q-layout class="column justify-end items-center q-pb-lg">
|
|
3
|
+
<div>
|
|
4
4
|
<div class="column">
|
|
5
5
|
<div class="column justify-center" style="height: 35vh">
|
|
6
6
|
<div class="row justify-center">
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
@retypeEmail="retypeEmail"
|
|
130
130
|
>
|
|
131
131
|
<q-btn
|
|
132
|
-
v-if="
|
|
132
|
+
v-if="sendEmailSuccess && isOtp"
|
|
133
133
|
class="q-mt-md full-width"
|
|
134
134
|
unelevated
|
|
135
135
|
style="background: #fff"
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
</sowell-message>
|
|
144
144
|
</q-dialog>
|
|
145
145
|
</div>
|
|
146
|
-
</
|
|
146
|
+
</div>
|
|
147
147
|
<q-footer class="footer">
|
|
148
148
|
<q-toolbar>
|
|
149
149
|
<q-toolbar-title>
|
|
@@ -190,15 +190,15 @@ export default defineComponent({
|
|
|
190
190
|
} = useAuth();
|
|
191
191
|
|
|
192
192
|
const handleSubmit = () => {
|
|
193
|
-
onSubmit()
|
|
194
|
-
}
|
|
193
|
+
onSubmit();
|
|
194
|
+
};
|
|
195
195
|
|
|
196
196
|
const appVersion = reactive({
|
|
197
197
|
versionNumber: "",
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
const isOtp = computed(() => IS_OTP.toLowerCase() === "y")
|
|
201
|
-
|
|
200
|
+
const isOtp = computed(() => IS_OTP.toLowerCase() === "y");
|
|
201
|
+
|
|
202
202
|
const resetPassword = async (email: string) => {
|
|
203
203
|
const data = {
|
|
204
204
|
auth: {
|
|
@@ -262,3 +262,4 @@ div.q-field__messages {
|
|
|
262
262
|
display: none;
|
|
263
263
|
}
|
|
264
264
|
</style>
|
|
265
|
+
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-layout>
|
|
3
|
-
<
|
|
2
|
+
<q-layout class="q-pa-md row justify-center">
|
|
3
|
+
<div>
|
|
4
4
|
<div>
|
|
5
5
|
<div class="q-mt-xl">
|
|
6
6
|
<img
|
|
7
7
|
src="../../assets/Sowell-logo.svg"
|
|
8
|
-
class="q-mb-sm
|
|
8
|
+
class="q-mb-sm"
|
|
9
9
|
style="width: 190px"
|
|
10
10
|
/>
|
|
11
11
|
</div>
|
|
12
|
-
<div
|
|
13
|
-
class="column justify-center full-height"
|
|
14
|
-
style="max-width: 550px; margin-top: -90px"
|
|
15
|
-
>
|
|
12
|
+
<div class="column justify-center full-height" style="max-width: 550px">
|
|
16
13
|
<div></div>
|
|
17
14
|
<div
|
|
18
15
|
class="text-subtitle1 q-mt-lg"
|
|
@@ -73,7 +70,7 @@
|
|
|
73
70
|
</q-form>
|
|
74
71
|
</div>
|
|
75
72
|
</div>
|
|
76
|
-
</
|
|
73
|
+
</div>
|
|
77
74
|
</q-layout>
|
|
78
75
|
</template>
|
|
79
76
|
|
|
@@ -180,3 +177,4 @@ export default defineComponent({
|
|
|
180
177
|
width: 254px;
|
|
181
178
|
}
|
|
182
179
|
</style>
|
|
180
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-layout>
|
|
3
|
-
<
|
|
2
|
+
<q-layout class="q-pa-md row justify-center full-height">
|
|
3
|
+
<div>
|
|
4
4
|
<div style="max-width: 342px">
|
|
5
5
|
<div>
|
|
6
6
|
<q-btn
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
@goToLoginPage="goToLoginPage"
|
|
72
72
|
/>
|
|
73
73
|
</q-dialog>
|
|
74
|
-
</
|
|
74
|
+
</div>
|
|
75
75
|
</q-layout>
|
|
76
76
|
</template>
|
|
77
77
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-layout>
|
|
3
|
-
<
|
|
2
|
+
<q-layout class="q-pa-md row justify-center">
|
|
3
|
+
<div>
|
|
4
4
|
<div>
|
|
5
5
|
<div class="q-mt-xl">
|
|
6
6
|
<img
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
@goToLoginPage="goToLoginPage"
|
|
87
87
|
/>
|
|
88
88
|
</q-dialog>
|
|
89
|
-
</
|
|
89
|
+
</div>
|
|
90
90
|
</q-layout>
|
|
91
91
|
</template>
|
|
92
92
|
|
|
@@ -132,3 +132,4 @@ export default defineComponent({
|
|
|
132
132
|
width: 254px;
|
|
133
133
|
}
|
|
134
134
|
</style>
|
|
135
|
+
|
package/src/injects/index.ts
CHANGED
package/src/injects/prompts.ts
CHANGED
|
@@ -10,11 +10,6 @@ export interface PromptsInterface {
|
|
|
10
10
|
AUTH_SERVER_RESET_PASSWORD_ROUTE: string;
|
|
11
11
|
AUTH_SERVER_UPDATE_PASSWORD_ROUTE: string;
|
|
12
12
|
AUTH_TYPE: string;
|
|
13
|
-
VUEX_SET_TOKEN_MUTATION: string;
|
|
14
|
-
VUEX_CLEAR_TOKEN_MUTATION: string;
|
|
15
|
-
VUEX_SET_INFOS_USER_MUTATION: string;
|
|
16
|
-
VUEX_GET_TOKEN_GETTER: string;
|
|
17
|
-
VUEX_GET_INFOS_USER_GETTER: string;
|
|
18
13
|
X_REQUESTED_ROLES: string;
|
|
19
14
|
WELCOME_TITLE: string;
|
|
20
15
|
WELCOME_SUBTITLE: string;
|
|
@@ -23,7 +18,7 @@ export interface PromptsInterface {
|
|
|
23
18
|
AUTH_SERVER_VERIFY_OTP: string;
|
|
24
19
|
UI_PAGE: string;
|
|
25
20
|
APP_VERSION: string;
|
|
26
|
-
USE_SSO: boolean
|
|
21
|
+
USE_SSO: boolean;
|
|
27
22
|
}
|
|
28
23
|
export const $prompts = (): PromptsInterface => {
|
|
29
24
|
const $prompts = inject<Record<"@sowell/auth", PromptsInterface>>("$prompts");
|
package/src/interfaces/Boot.ts
CHANGED
package/src/prompts.js
CHANGED
|
@@ -64,20 +64,6 @@ module.exports = function () {
|
|
|
64
64
|
message: "Authorization type",
|
|
65
65
|
default: "Bearer",
|
|
66
66
|
},
|
|
67
|
-
{
|
|
68
|
-
name: "VUEX_SET_TOKEN_MUTATION",
|
|
69
|
-
type: "input",
|
|
70
|
-
required: true,
|
|
71
|
-
message: "Vuex mutation to set token",
|
|
72
|
-
default: "auth/set_token",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "VUEX_CLEAR_TOKEN_MUTATION",
|
|
76
|
-
type: "input",
|
|
77
|
-
required: true,
|
|
78
|
-
message: "Vuex mutation to clear token",
|
|
79
|
-
default: "auth/clear_token",
|
|
80
|
-
},
|
|
81
67
|
{
|
|
82
68
|
name: "UI_PAGE",
|
|
83
69
|
type: "input",
|
|
@@ -85,34 +71,6 @@ module.exports = function () {
|
|
|
85
71
|
message: "Login page for mobile app",
|
|
86
72
|
default: "",
|
|
87
73
|
},
|
|
88
|
-
{
|
|
89
|
-
name: "VUEX_SET_EMAIL_MUTATION",
|
|
90
|
-
type: "input",
|
|
91
|
-
required: true,
|
|
92
|
-
message: "Vuex mutation to store user email when authenticated",
|
|
93
|
-
default: "auth/set_email_user",
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: "VUEX_SET_INFOS_USER_MUTATION",
|
|
97
|
-
type: "input",
|
|
98
|
-
required: true,
|
|
99
|
-
message: "Vuex mutation to set user information to reset password",
|
|
100
|
-
default: "auth/set_infos_user",
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: "VUEX_GET_TOKEN_GETTER",
|
|
104
|
-
type: "input",
|
|
105
|
-
required: true,
|
|
106
|
-
message: "Vuex getter token",
|
|
107
|
-
default: "auth/get_token",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "VUEX_GET_INFOS_USER_GETTER",
|
|
111
|
-
type: "input",
|
|
112
|
-
required: true,
|
|
113
|
-
message: "Vuex getter user information",
|
|
114
|
-
default: "auth/get_infos_user",
|
|
115
|
-
},
|
|
116
74
|
{
|
|
117
75
|
name: "X_REQUESTED_ROLES",
|
|
118
76
|
type: "input",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: Cypress Tests
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
cypress-run:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
steps:
|
|
9
|
-
- name: Checkout
|
|
10
|
-
uses: actions/checkout@v2
|
|
11
|
-
- name: Nodejs
|
|
12
|
-
uses: actions/setup-node@v2
|
|
13
|
-
with:
|
|
14
|
-
node-version: '14'
|
|
15
|
-
cache: yarn
|
|
16
|
-
- run: yarn install
|
|
17
|
-
- run: yarn dep
|
|
18
|
-
- name: Cypress run
|
|
19
|
-
uses: cypress-io/github-action@v2
|
|
20
|
-
with:
|
|
21
|
-
working-directory: dev
|
|
22
|
-
command: yarn test
|
package/src/injects/store.ts
DELETED
package/src/store/index.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Module, GetterTree, MutationTree, ActionTree } from "vuex";
|
|
2
|
-
import { tokenStateInterface, payload } from "../interfaces";
|
|
3
|
-
|
|
4
|
-
const state: tokenStateInterface = {
|
|
5
|
-
raw: "",
|
|
6
|
-
payload: {
|
|
7
|
-
company_hp: undefined,
|
|
8
|
-
exp: undefined,
|
|
9
|
-
gm_key: "",
|
|
10
|
-
roles: [],
|
|
11
|
-
sub: null
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const getters: GetterTree<tokenStateInterface, any> = {
|
|
16
|
-
getRaw(state) {
|
|
17
|
-
return state.raw
|
|
18
|
-
},
|
|
19
|
-
getPayload(state) {
|
|
20
|
-
return state.payload
|
|
21
|
-
},
|
|
22
|
-
getIsValid(state) {
|
|
23
|
-
if (state.payload.exp) {
|
|
24
|
-
return new Date(state.payload.exp * 1000) >= new Date() ? true : false;
|
|
25
|
-
} else {
|
|
26
|
-
return false
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const mutations: MutationTree<tokenStateInterface> = {
|
|
32
|
-
setRaw(state, value: string) {
|
|
33
|
-
state.raw = value
|
|
34
|
-
},
|
|
35
|
-
setPayload(state, value: payload) {
|
|
36
|
-
state.payload = {...value}
|
|
37
|
-
},
|
|
38
|
-
reset(state) {
|
|
39
|
-
state.raw = ""
|
|
40
|
-
state.payload = {
|
|
41
|
-
company_hp: undefined,
|
|
42
|
-
exp: undefined,
|
|
43
|
-
gm_key: "",
|
|
44
|
-
roles: [],
|
|
45
|
-
sub: null
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const actions: ActionTree<tokenStateInterface, any> = {
|
|
51
|
-
updateRaw({ commit }, value: string) {
|
|
52
|
-
commit("setRaw", value);
|
|
53
|
-
let parseJwt: string
|
|
54
|
-
try {
|
|
55
|
-
parseJwt = JSON.parse(window.atob(value.split(".")[1]));
|
|
56
|
-
} catch (error) {
|
|
57
|
-
parseJwt = ""
|
|
58
|
-
}
|
|
59
|
-
commit("setPayload", parseJwt)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const tokenModule: Module<tokenStateInterface, any> = {
|
|
64
|
-
namespaced: true,
|
|
65
|
-
getters,
|
|
66
|
-
mutations,
|
|
67
|
-
actions,
|
|
68
|
-
state
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default tokenModule;
|