@eid-easy/eideasy-browser-client 2.7.0 → 2.10.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/CHANGELOG.md +46 -2
- package/README.md +1 -2
- package/dist/eideasy-browser-client.js +1 -1
- package/package.json +8 -5
- package/.editorconfig +0 -14
- package/.env.development +0 -1
- package/.env.production +0 -1
- package/.env.staging +0 -1
- package/.eslintrc.js +0 -22
- package/.github/ISSUE_TEMPLATE/---bug-report.md +0 -35
- package/.github/ISSUE_TEMPLATE/---feature-request.md +0 -20
- package/.github/workflows/ci.yml +0 -37
- package/.github/workflows/github-release.yml +0 -24
- package/babel.config.js +0 -19
- package/build-utils/loadPresets.js +0 -12
- package/build-utils/presets/webpack.analyze.js +0 -5
- package/build-utils/presets/webpack.compress.js +0 -5
- package/build-utils/webpack.development.js +0 -3
- package/build-utils/webpack.production.js +0 -3
- package/docs/.vuepress/components/AppChallenge.vue +0 -24
- package/docs/.vuepress/components/AppError.vue +0 -55
- package/docs/.vuepress/components/AppIdentification.vue +0 -177
- package/docs/.vuepress/components/AppSigning.vue +0 -171
- package/docs/.vuepress/components/GetClientConfig.vue +0 -56
- package/docs/.vuepress/components/IdentAtHandy.vue +0 -102
- package/docs/.vuepress/components/IdentEParakstsMobile.vue +0 -111
- package/docs/.vuepress/components/IdentFinnishTrustNetwork.vue +0 -102
- package/docs/.vuepress/components/IdentFrejaEid.vue +0 -86
- package/docs/.vuepress/components/IdentIdCard.vue +0 -65
- package/docs/.vuepress/components/IdentMobileId.vue +0 -100
- package/docs/.vuepress/components/IdentMojeId.vue +0 -99
- package/docs/.vuepress/components/IdentSmartId.vue +0 -93
- package/docs/.vuepress/components/IdentZealId.vue +0 -85
- package/docs/.vuepress/components/MethodCard.vue +0 -95
- package/docs/.vuepress/components/SignAtHandy.vue +0 -103
- package/docs/.vuepress/components/SignEParakstsMobile.vue +0 -103
- package/docs/.vuepress/components/SignEvrotrust.vue +0 -113
- package/docs/.vuepress/components/SignFtn.vue +0 -103
- package/docs/.vuepress/components/SignIdCard.vue +0 -70
- package/docs/.vuepress/components/SignMobileId.vue +0 -100
- package/docs/.vuepress/components/SignOtp.vue +0 -93
- package/docs/.vuepress/components/SignSmartId.vue +0 -89
- package/docs/.vuepress/components/SignZealId.vue +0 -106
- package/docs/.vuepress/components/eidEasyDemoClient.js +0 -25
- package/docs/.vuepress/components/logResult.js +0 -17
- package/docs/.vuepress/config.js +0 -34
- package/docs/.vuepress/public/assets/img/eid-easy-icon.png +0 -0
- package/docs/.vuepress/public/assets/img/eid-easy-logo.png +0 -0
- package/docs/.vuepress/styles/core.scss +0 -32
- package/docs/.vuepress/styles/index.scss +0 -124
- package/docs/.vuepress/styles/palette.scss +0 -9
- package/docs/.vuepress/styles/variables.scss +0 -1468
- package/docs/README.md +0 -12
- package/docs/contributing/README.md +0 -47
- package/docs/demos/README.md +0 -21
- package/docs/guide/README.md +0 -248
- package/jest.config.js +0 -16
- package/scripts/release.js +0 -204
- package/scripts/update-translations.js +0 -19
- package/src/MethodException.js +0 -10
- package/src/apiClient/createApiClient.js +0 -52
- package/src/apiClient/createApiClient.test.js +0 -20
- package/src/apiClient/createApiEndpoints.js +0 -71
- package/src/cloneDeep.js +0 -3
- package/src/config.js +0 -260
- package/src/coreSettingsSchema.js +0 -76
- package/src/createApiPoller.js +0 -54
- package/src/createClientCore.js +0 -84
- package/src/createGetClientConfig.js +0 -14
- package/src/createModuleCreator.js +0 -66
- package/src/createMonitoringService.js +0 -33
- package/src/createRequestError.js +0 -24
- package/src/createSettings.js +0 -26
- package/src/createStep.js +0 -49
- package/src/formatError.js +0 -19
- package/src/i18n/createI18n.js +0 -52
- package/src/i18n/createI18n.test.js +0 -63
- package/src/i18n/de.json +0 -1
- package/src/i18n/en.json +0 -1
- package/src/i18n/et.json +0 -1
- package/src/i18n/lt.json +0 -1
- package/src/i18n/lv.json +0 -1
- package/src/i18n/ru.json +0 -1
- package/src/identificationModules/createAtHandy.js +0 -37
- package/src/identificationModules/createEParakstsMobile.js +0 -37
- package/src/identificationModules/createFinnishTrustNetwork.js +0 -40
- package/src/identificationModules/createFrejaEid.js +0 -118
- package/src/identificationModules/createIdCard.js +0 -70
- package/src/identificationModules/createMobileId.js +0 -117
- package/src/identificationModules/createMojeId.js +0 -37
- package/src/identificationModules/createSmartId.js +0 -110
- package/src/identificationModules/createZealId.js +0 -107
- package/src/identificationModules/identificationModules.js +0 -21
- package/src/identificationModules/identificationModules.test.js +0 -21
- package/src/index.js +0 -9
- package/src/main.js +0 -78
- package/src/modes.js +0 -6
- package/src/poll.js +0 -36
- package/src/request.js +0 -45
- package/src/signatureModules/createAtHandySignature.js +0 -70
- package/src/signatureModules/createEParakstsMobileSignature.js +0 -70
- package/src/signatureModules/createEvrotrustSignature.js +0 -144
- package/src/signatureModules/createFtnSignature.js +0 -70
- package/src/signatureModules/createIdCardSignature.js +0 -217
- package/src/signatureModules/createMobileIdSignature.js +0 -129
- package/src/signatureModules/createOtpSignature.js +0 -68
- package/src/signatureModules/createSmartIdSignature.js +0 -124
- package/src/signatureModules/createZealIdSignature.js +0 -37
- package/src/signatureModules/signatureModules.js +0 -21
- package/src/tests/cloneDeep.test.js +0 -31
- package/src/tests/config.test.js +0 -25
- package/src/tests/createRequestError.test.js +0 -36
- package/src/tests/main.test.js +0 -7
- package/src/tests/poll.test.js +0 -64
- package/src/tests/windowOpen.test.js +0 -43
- package/src/windowOpen.js +0 -46
- package/webpack.config.js +0 -55
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MethodCard from './MethodCard';
|
|
3
|
-
import logResult from './logResult';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
name: 'SignFtn',
|
|
7
|
-
components: {
|
|
8
|
-
MethodCard,
|
|
9
|
-
},
|
|
10
|
-
data() {
|
|
11
|
-
return {
|
|
12
|
-
isLoading: false,
|
|
13
|
-
challenge: null,
|
|
14
|
-
signingProcess: null,
|
|
15
|
-
customInsteadOfRedirect: 'none',
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
eidEasyClient: {
|
|
20
|
-
default: null,
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
countryCode: {
|
|
24
|
-
default: null,
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
getFieldId(id) {
|
|
30
|
-
return this.$options.name + '-' + id;
|
|
31
|
-
},
|
|
32
|
-
handleStartClick({
|
|
33
|
-
addErrors,
|
|
34
|
-
addSuccess,
|
|
35
|
-
startLoading,
|
|
36
|
-
endLoading,
|
|
37
|
-
}) {
|
|
38
|
-
startLoading();
|
|
39
|
-
const config = {
|
|
40
|
-
countryCode: this.countryCode,
|
|
41
|
-
fail: (result) => {
|
|
42
|
-
logResult(result, 'fail');
|
|
43
|
-
addErrors(result);
|
|
44
|
-
},
|
|
45
|
-
success: (result) => {
|
|
46
|
-
logResult(result, 'success');
|
|
47
|
-
addSuccess(result);
|
|
48
|
-
},
|
|
49
|
-
finished: (result) => {
|
|
50
|
-
logResult(result, 'finished');
|
|
51
|
-
endLoading();
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
if (this.customInsteadOfRedirect === 'error') {
|
|
56
|
-
config.redirect = () => ({
|
|
57
|
-
data: 'Some data',
|
|
58
|
-
error: new Error('A mock error'),
|
|
59
|
-
});
|
|
60
|
-
} else if (this.customInsteadOfRedirect === 'data') {
|
|
61
|
-
config.redirect = () => new Promise((resolve) => {
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
resolve({
|
|
64
|
-
data: 'Some data',
|
|
65
|
-
});
|
|
66
|
-
}, 2000);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
this.signingProcess = this.eidEasyClient.signature.ftnSignature.start(config);
|
|
70
|
-
},
|
|
71
|
-
handleCancelClick() {
|
|
72
|
-
this.signingProcess && this.signingProcess.cancel();
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
}
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<template>
|
|
79
|
-
<MethodCard
|
|
80
|
-
title="FTN signing"
|
|
81
|
-
:on-start-click="handleStartClick"
|
|
82
|
-
:on-cancel-click="handleCancelClick"
|
|
83
|
-
>
|
|
84
|
-
<div class="form-check">
|
|
85
|
-
<input v-model="customInsteadOfRedirect" class="form-check-input" value="none" type="radio" :id="getFieldId('redirectOption1')">
|
|
86
|
-
<label class="form-check-label" :for="getFieldId('redirectOption1')">
|
|
87
|
-
No custom redirect
|
|
88
|
-
</label>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="form-check">
|
|
91
|
-
<input v-model="customInsteadOfRedirect" class="form-check-input" type="radio" value="error" :id="getFieldId('redirectOption2')">
|
|
92
|
-
<label class="form-check-label" :for="getFieldId('redirectOption2')">
|
|
93
|
-
Custom redirect function that has an error in the result object
|
|
94
|
-
</label>
|
|
95
|
-
</div>
|
|
96
|
-
<div class="form-check">
|
|
97
|
-
<input v-model="customInsteadOfRedirect" class="form-check-input" type="radio" value="data" :id="getFieldId('redirectOption3')">
|
|
98
|
-
<label class="form-check-label" :for="getFieldId('redirectOption3')">
|
|
99
|
-
Custom redirect function that has data in the result object
|
|
100
|
-
</label>
|
|
101
|
-
</div>
|
|
102
|
-
</MethodCard>
|
|
103
|
-
</template>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MethodCard from './MethodCard';
|
|
3
|
-
import logResult from './logResult';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
name: 'SignIdCard',
|
|
7
|
-
components: {
|
|
8
|
-
MethodCard,
|
|
9
|
-
},
|
|
10
|
-
data() {
|
|
11
|
-
return {
|
|
12
|
-
isLoading: false,
|
|
13
|
-
challenge: null,
|
|
14
|
-
signingProcess: null,
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
eidEasyClient: {
|
|
19
|
-
default: null,
|
|
20
|
-
required: true,
|
|
21
|
-
},
|
|
22
|
-
countryCode: {
|
|
23
|
-
default: null,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
methods: {
|
|
28
|
-
handleStartClick({
|
|
29
|
-
addErrors,
|
|
30
|
-
addSuccess,
|
|
31
|
-
startLoading,
|
|
32
|
-
endLoading,
|
|
33
|
-
}) {
|
|
34
|
-
startLoading();
|
|
35
|
-
this.signingProcess = this.eidEasyClient.signature.idCardSignature.start({
|
|
36
|
-
countryCode: this.countryCode,
|
|
37
|
-
iframeHolder: this.$refs.iframeHolder,
|
|
38
|
-
fail: (result) => {
|
|
39
|
-
logResult(result, 'fail');
|
|
40
|
-
addErrors(result);
|
|
41
|
-
},
|
|
42
|
-
success: (result) => {
|
|
43
|
-
logResult(result, 'success');
|
|
44
|
-
addSuccess(result);
|
|
45
|
-
},
|
|
46
|
-
finished: (result) => {
|
|
47
|
-
logResult(result, 'finished');
|
|
48
|
-
endLoading();
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
handleCancelClick() {
|
|
53
|
-
this.signingProcess && this.signingProcess.cancel();
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<template>
|
|
60
|
-
<MethodCard
|
|
61
|
-
title="ID Card signing"
|
|
62
|
-
:on-start-click="handleStartClick"
|
|
63
|
-
:on-cancel-click="handleCancelClick"
|
|
64
|
-
>
|
|
65
|
-
<div
|
|
66
|
-
ref="iframeHolder"
|
|
67
|
-
/>
|
|
68
|
-
</MethodCard>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MethodCard from './MethodCard';
|
|
3
|
-
import AppChallenge from './AppChallenge';
|
|
4
|
-
import logResult from './logResult';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
name: 'SignMobileId',
|
|
8
|
-
components: {
|
|
9
|
-
MethodCard,
|
|
10
|
-
AppChallenge,
|
|
11
|
-
},
|
|
12
|
-
data() {
|
|
13
|
-
return {
|
|
14
|
-
idcode: '',
|
|
15
|
-
phone: '',
|
|
16
|
-
isLoading: false,
|
|
17
|
-
errors: null,
|
|
18
|
-
challenge: null,
|
|
19
|
-
signingProcess: null,
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
props: {
|
|
23
|
-
eidEasyClient: {
|
|
24
|
-
default: null,
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
countryCode: {
|
|
28
|
-
default: null,
|
|
29
|
-
required: true,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
handleStartClick({
|
|
34
|
-
addErrors,
|
|
35
|
-
addSuccess,
|
|
36
|
-
startLoading,
|
|
37
|
-
endLoading,
|
|
38
|
-
}) {
|
|
39
|
-
startLoading();
|
|
40
|
-
this.signingProcess = this.eidEasyClient.signature.mobileIdSignature.start({
|
|
41
|
-
countryCode: this.countryCode,
|
|
42
|
-
idcode: this.idcode,
|
|
43
|
-
phone: this.phone,
|
|
44
|
-
started: (result) => {
|
|
45
|
-
logResult(result, 'started');
|
|
46
|
-
this.challenge = result.data.challenge;
|
|
47
|
-
},
|
|
48
|
-
fail: (result) => {
|
|
49
|
-
logResult(result, 'fail');
|
|
50
|
-
addErrors(result);
|
|
51
|
-
},
|
|
52
|
-
success: (result) => {
|
|
53
|
-
logResult(result, 'success');
|
|
54
|
-
addSuccess(result);
|
|
55
|
-
},
|
|
56
|
-
finished: (result) => {
|
|
57
|
-
logResult(result, 'finished');
|
|
58
|
-
this.challenge = null;
|
|
59
|
-
endLoading();
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
handleCancelClick() {
|
|
64
|
-
this.signingProcess && this.signingProcess.cancel();
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
}
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<template>
|
|
71
|
-
<MethodCard
|
|
72
|
-
title="Mobile ID signing"
|
|
73
|
-
:on-start-click="handleStartClick"
|
|
74
|
-
:on-cancel-click="handleCancelClick"
|
|
75
|
-
>
|
|
76
|
-
<AppChallenge
|
|
77
|
-
v-if="challenge"
|
|
78
|
-
class="mb-3"
|
|
79
|
-
:code="challenge"
|
|
80
|
-
/>
|
|
81
|
-
<div class="mb-3">
|
|
82
|
-
<label for="idCodeInputMobileSign" class="form-label">Personal Identity Code</label>
|
|
83
|
-
<input
|
|
84
|
-
v-model="idcode"
|
|
85
|
-
type="text"
|
|
86
|
-
class="form-control"
|
|
87
|
-
id="idCodeInputMobileSign"
|
|
88
|
-
>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="mb-3">
|
|
91
|
-
<label for="phoneInputMobileSign" class="form-label">Phone Number</label>
|
|
92
|
-
<input
|
|
93
|
-
v-model="phone"
|
|
94
|
-
type="text"
|
|
95
|
-
class="form-control"
|
|
96
|
-
id="phoneInputMobileSign"
|
|
97
|
-
>
|
|
98
|
-
</div>
|
|
99
|
-
</MethodCard>
|
|
100
|
-
</template>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MethodCard from './MethodCard';
|
|
3
|
-
import AppChallenge from './AppChallenge';
|
|
4
|
-
import logResult from './logResult';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
name: 'SignOtp',
|
|
8
|
-
components: {
|
|
9
|
-
MethodCard,
|
|
10
|
-
AppChallenge,
|
|
11
|
-
},
|
|
12
|
-
data() {
|
|
13
|
-
return {
|
|
14
|
-
emailToken: '',
|
|
15
|
-
smsToken: '',
|
|
16
|
-
isLoading: false,
|
|
17
|
-
errors: null,
|
|
18
|
-
challenge: null,
|
|
19
|
-
signingProcess: null,
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
props: {
|
|
23
|
-
eidEasyClient: {
|
|
24
|
-
default: null,
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
handleStartClick({
|
|
30
|
-
addErrors,
|
|
31
|
-
addSuccess,
|
|
32
|
-
startLoading,
|
|
33
|
-
endLoading,
|
|
34
|
-
}) {
|
|
35
|
-
startLoading();
|
|
36
|
-
this.signingProcess = this.eidEasyClient.signature.otpSignature.start({
|
|
37
|
-
countryCode: this.countryCode,
|
|
38
|
-
smsToken: this.smsToken,
|
|
39
|
-
emailToken: this.emailToken,
|
|
40
|
-
fail: (result) => {
|
|
41
|
-
logResult(result, 'fail');
|
|
42
|
-
addErrors(result);
|
|
43
|
-
},
|
|
44
|
-
success: (result) => {
|
|
45
|
-
logResult(result, 'success');
|
|
46
|
-
addSuccess(result);
|
|
47
|
-
},
|
|
48
|
-
finished: (result) => {
|
|
49
|
-
logResult(result, 'finished');
|
|
50
|
-
this.challenge = null;
|
|
51
|
-
endLoading();
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
handleCancelClick() {
|
|
56
|
-
this.signingProcess && this.signingProcess.cancel();
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
}
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<template>
|
|
63
|
-
<MethodCard
|
|
64
|
-
title="OTP signing"
|
|
65
|
-
:on-start-click="handleStartClick"
|
|
66
|
-
:on-cancel-click="handleCancelClick"
|
|
67
|
-
>
|
|
68
|
-
<AppChallenge
|
|
69
|
-
v-if="challenge"
|
|
70
|
-
class="mb-3"
|
|
71
|
-
:code="challenge"
|
|
72
|
-
/>
|
|
73
|
-
<div>
|
|
74
|
-
<label for="emailTokenOtp" class="form-label">Code sent to your e-mail</label>
|
|
75
|
-
<input
|
|
76
|
-
v-model="emailToken"
|
|
77
|
-
type="text"
|
|
78
|
-
class="form-control"
|
|
79
|
-
id="emailTokenOtp"
|
|
80
|
-
>
|
|
81
|
-
</div>
|
|
82
|
-
<div class="mt-2 mb-2 text-center">or:</div>
|
|
83
|
-
<div class="mb-3">
|
|
84
|
-
<label for="smsTokenOtp" class="form-label">Code sent to your phone</label>
|
|
85
|
-
<input
|
|
86
|
-
v-model="smsToken"
|
|
87
|
-
type="number"
|
|
88
|
-
class="form-control"
|
|
89
|
-
id="smsTokenOtp"
|
|
90
|
-
>
|
|
91
|
-
</div>
|
|
92
|
-
</MethodCard>
|
|
93
|
-
</template>
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MethodCard from './MethodCard';
|
|
3
|
-
import AppChallenge from './AppChallenge';
|
|
4
|
-
import logResult from './logResult';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
name: 'SignSmartId',
|
|
8
|
-
components: {
|
|
9
|
-
MethodCard,
|
|
10
|
-
AppChallenge,
|
|
11
|
-
},
|
|
12
|
-
data() {
|
|
13
|
-
return {
|
|
14
|
-
idcode: '',
|
|
15
|
-
isLoading: false,
|
|
16
|
-
errors: null,
|
|
17
|
-
challenge: null,
|
|
18
|
-
signingProcess: null,
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
props: {
|
|
22
|
-
eidEasyClient: {
|
|
23
|
-
default: null,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
countryCode: {
|
|
27
|
-
default: null,
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
handleStartClick({
|
|
33
|
-
addErrors,
|
|
34
|
-
addSuccess,
|
|
35
|
-
startLoading,
|
|
36
|
-
endLoading,
|
|
37
|
-
}) {
|
|
38
|
-
startLoading();
|
|
39
|
-
this.identificationProcess = this.eidEasyClient.signature.smartIdSignature.start({
|
|
40
|
-
countryCode: this.countryCode,
|
|
41
|
-
idcode: this.idcode,
|
|
42
|
-
started: (result) => {
|
|
43
|
-
logResult(result, 'started');
|
|
44
|
-
this.challenge = result.data.challenge;
|
|
45
|
-
},
|
|
46
|
-
fail: (result) => {
|
|
47
|
-
logResult(result, 'fail');
|
|
48
|
-
addErrors(result);
|
|
49
|
-
},
|
|
50
|
-
success: (result) => {
|
|
51
|
-
logResult(result, 'success');
|
|
52
|
-
addSuccess(result);
|
|
53
|
-
},
|
|
54
|
-
finished: (result) => {
|
|
55
|
-
logResult(result, 'finished');
|
|
56
|
-
this.challenge = null;
|
|
57
|
-
endLoading();
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
handleCancelClick() {
|
|
62
|
-
this.identificationProcess && this.identificationProcess.cancel();
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<template>
|
|
69
|
-
<MethodCard
|
|
70
|
-
title="Smart ID signing"
|
|
71
|
-
:on-start-click="handleStartClick"
|
|
72
|
-
:on-cancel-click="handleCancelClick"
|
|
73
|
-
>
|
|
74
|
-
<AppChallenge
|
|
75
|
-
v-if="challenge"
|
|
76
|
-
class="mb-3"
|
|
77
|
-
:code="challenge"
|
|
78
|
-
/>
|
|
79
|
-
<div class="mb-3">
|
|
80
|
-
<label for="idCodeInputSigning" class="form-label">Personal Identity Code</label>
|
|
81
|
-
<input
|
|
82
|
-
v-model="idcode"
|
|
83
|
-
type="text"
|
|
84
|
-
class="form-control"
|
|
85
|
-
id="idCodeInputSigning"
|
|
86
|
-
>
|
|
87
|
-
</div>
|
|
88
|
-
</MethodCard>
|
|
89
|
-
</template>
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MethodCard from './MethodCard';
|
|
3
|
-
import logResult from './logResult';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
name: 'SignZealId',
|
|
7
|
-
components: {
|
|
8
|
-
MethodCard,
|
|
9
|
-
},
|
|
10
|
-
data() {
|
|
11
|
-
return {
|
|
12
|
-
isLoading: false,
|
|
13
|
-
challenge: null,
|
|
14
|
-
signingProcess: null,
|
|
15
|
-
customInsteadOfRedirect: 'none',
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
eidEasyClient: {
|
|
20
|
-
default: null,
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
countryCode: {
|
|
24
|
-
default: null,
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
getFieldId(id) {
|
|
30
|
-
return this.$options.name + '-' + id;
|
|
31
|
-
},
|
|
32
|
-
handleStartClick({
|
|
33
|
-
addErrors,
|
|
34
|
-
addSuccess,
|
|
35
|
-
startLoading,
|
|
36
|
-
endLoading,
|
|
37
|
-
}) {
|
|
38
|
-
startLoading();
|
|
39
|
-
const config = {
|
|
40
|
-
countryCode: this.countryCode,
|
|
41
|
-
fail: (result) => {
|
|
42
|
-
logResult(result, 'fail');
|
|
43
|
-
addErrors(result);
|
|
44
|
-
},
|
|
45
|
-
success: (result) => {
|
|
46
|
-
logResult(result, 'success');
|
|
47
|
-
addSuccess(result);
|
|
48
|
-
},
|
|
49
|
-
finished: (result) => {
|
|
50
|
-
logResult(result, 'finished');
|
|
51
|
-
endLoading();
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
if (this.customInsteadOfRedirect === 'error') {
|
|
56
|
-
config.redirect = () => ({
|
|
57
|
-
data: 'Some data',
|
|
58
|
-
error: new Error('A mock error'),
|
|
59
|
-
});
|
|
60
|
-
} else if (this.customInsteadOfRedirect === 'data') {
|
|
61
|
-
config.redirect = () => new Promise((resolve) => {
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
resolve({
|
|
64
|
-
data: 'Some data',
|
|
65
|
-
});
|
|
66
|
-
}, 2000);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
this.signingProcess = this.eidEasyClient.signature.zealIdSignature.start(config);
|
|
70
|
-
},
|
|
71
|
-
handleCancelClick() {
|
|
72
|
-
this.signingProcess && this.signingProcess.cancel();
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
}
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<template>
|
|
79
|
-
<MethodCard
|
|
80
|
-
title="Zeal ID signing"
|
|
81
|
-
:on-start-click="handleStartClick"
|
|
82
|
-
:on-cancel-click="handleCancelClick"
|
|
83
|
-
>
|
|
84
|
-
<div class="form-check">
|
|
85
|
-
<input v-model="customInsteadOfRedirect" class="form-check-input" value="none" type="radio"
|
|
86
|
-
:id="getFieldId('redirectOption1')">
|
|
87
|
-
<label class="form-check-label" :for="getFieldId('redirectOption1')">
|
|
88
|
-
No custom redirect
|
|
89
|
-
</label>
|
|
90
|
-
</div>
|
|
91
|
-
<div class="form-check">
|
|
92
|
-
<input v-model="customInsteadOfRedirect" class="form-check-input" type="radio" value="error"
|
|
93
|
-
:id="getFieldId('redirectOption2')">
|
|
94
|
-
<label class="form-check-label" :for="getFieldId('redirectOption2')">
|
|
95
|
-
Custom redirect function that has an error in the result object
|
|
96
|
-
</label>
|
|
97
|
-
</div>
|
|
98
|
-
<div class="form-check">
|
|
99
|
-
<input v-model="customInsteadOfRedirect" class="form-check-input" type="radio" value="data"
|
|
100
|
-
:id="getFieldId('redirectOption3')">
|
|
101
|
-
<label class="form-check-label" :for="getFieldId('redirectOption3')">
|
|
102
|
-
Custom redirect function that has data in the result object
|
|
103
|
-
</label>
|
|
104
|
-
</div>
|
|
105
|
-
</MethodCard>
|
|
106
|
-
</template>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import createClient from '../../../src/index';
|
|
2
|
-
|
|
3
|
-
const eidEasyDemoClient = createClient({
|
|
4
|
-
countryCode: 'FI',
|
|
5
|
-
sandbox: true,
|
|
6
|
-
clientId: 'SNcycaJFfibUABHrbx6c51YRqSiV76Nz',
|
|
7
|
-
redirectUri: 'http://localhost:8080', // this gets used for redirects back to this application e.g. when using eParaksts mobile
|
|
8
|
-
docId: 'CR1GsqrBICJmJMXTCxM82jxb8MlhLpWTacZARn4o',
|
|
9
|
-
remoteMonitoringEnabled: true,
|
|
10
|
-
apiEndpoints: {
|
|
11
|
-
base: () => 'https://id.eideasy.test',
|
|
12
|
-
identityStart: () => 'https://eid-sample-app.test/api/identity/start',
|
|
13
|
-
identityFinish: () => 'https://eid-sample-app.test/api/identity/finish',
|
|
14
|
-
},
|
|
15
|
-
modifyRequestSettings: () => {
|
|
16
|
-
return {
|
|
17
|
-
data: {
|
|
18
|
-
csrf_token: 'some-random-token',
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
language: 'en',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export default eidEasyDemoClient;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function logResult(result, tag) {
|
|
2
|
-
if (tag) {
|
|
3
|
-
console.log(`----- ${tag} -----`);
|
|
4
|
-
}
|
|
5
|
-
if (tag === 'fail') {
|
|
6
|
-
console.error(result);
|
|
7
|
-
if (result.response) {
|
|
8
|
-
console.error(result.response);
|
|
9
|
-
}
|
|
10
|
-
if (result.userMessage) {
|
|
11
|
-
console.error(result.userMessage);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
console.log(result);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default logResult;
|
package/docs/.vuepress/config.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const { path } = require('@vuepress/utils');
|
|
2
|
-
const { productionReleaseVersion, productionReleaseSri } = require('../../package');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
title: 'eideasy-browser-client',
|
|
6
|
-
description: 'eID Easy Browser Client allows consuming eID Easy API\'s in web browsers',
|
|
7
|
-
head: [['link', { rel: 'icon', href: '/assets/img/eid-easy-icon.png' }]],
|
|
8
|
-
themeConfig: {
|
|
9
|
-
repo: 'eideasy/eideasy-browser-client',
|
|
10
|
-
docsBranch: 'master',
|
|
11
|
-
docsDir: 'docs',
|
|
12
|
-
logo: '/assets/img/eid-easy-logo.png',
|
|
13
|
-
version: productionReleaseVersion,
|
|
14
|
-
sri: productionReleaseSri,
|
|
15
|
-
navbar: [
|
|
16
|
-
{ text: 'Home', link: '/'},
|
|
17
|
-
{ text: 'Guide', link: '/guide/'},
|
|
18
|
-
{ text: 'Demos', link: '/demos/'},
|
|
19
|
-
{ text: 'Contributing', link: '/contributing/'},
|
|
20
|
-
],
|
|
21
|
-
sidebar: 'auto',
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
[
|
|
25
|
-
'@vuepress/plugin-search',
|
|
26
|
-
],
|
|
27
|
-
[
|
|
28
|
-
'@vuepress/register-components',
|
|
29
|
-
{
|
|
30
|
-
componentsDir: path.resolve(__dirname, './components'),
|
|
31
|
-
},
|
|
32
|
-
]
|
|
33
|
-
],
|
|
34
|
-
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
|
|
2
|
-
@import "../../../node_modules/bootstrap/scss/functions";
|
|
3
|
-
|
|
4
|
-
// 2. Include any default variable overrides here
|
|
5
|
-
@import "variables";
|
|
6
|
-
|
|
7
|
-
// 3. Include remainder of required Bootstrap stylesheets
|
|
8
|
-
@import "../../../node_modules/bootstrap/scss/variables";
|
|
9
|
-
@import "../../../node_modules/bootstrap/scss/mixins";
|
|
10
|
-
@import "../../../node_modules/bootstrap/scss/utilities";
|
|
11
|
-
|
|
12
|
-
@import "../../../node_modules/bootstrap/scss/root";
|
|
13
|
-
@import "../../../node_modules/bootstrap/scss/reboot";
|
|
14
|
-
@import "../../../node_modules/bootstrap/scss/type";
|
|
15
|
-
@import "../../../node_modules/bootstrap/scss/images";
|
|
16
|
-
@import "../../../node_modules/bootstrap/scss/containers";
|
|
17
|
-
@import "../../../node_modules/bootstrap/scss/grid";
|
|
18
|
-
@import "../../../node_modules/bootstrap/scss/forms";
|
|
19
|
-
@import "../../../node_modules/bootstrap/scss/buttons";
|
|
20
|
-
@import "../../../node_modules/bootstrap/scss/spinners";
|
|
21
|
-
@import "../../../node_modules/bootstrap/scss/alert";
|
|
22
|
-
@import "../../../node_modules/bootstrap/scss/close";
|
|
23
|
-
@import "../../../node_modules/bootstrap/scss/card";
|
|
24
|
-
@import "../../../node_modules/bootstrap/scss/helpers";
|
|
25
|
-
@import "../../../node_modules/bootstrap/scss/utilities/api";
|
|
26
|
-
|
|
27
|
-
.btn.btn.btn {
|
|
28
|
-
&:hover,
|
|
29
|
-
&:focus {
|
|
30
|
-
text-decoration: none;
|
|
31
|
-
}
|
|
32
|
-
}
|