File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 53
53
import { LinkButton } from ' @/afcl' ;
54
54
import Vue2FACodeInput from ' @loltech/vue3-2fa-code-input' ;
55
55
import VOtpInput from " vue3-otp-input" ;
56
+ import { useI18n } from ' vue-i18n' ;
56
57
58
+ const { t } = useI18n ();
57
59
const code = ref (null );
58
60
59
61
const handleOnComplete = (value ) => {
118
120
if (resp .allowedLogin ){
119
121
await user .finishLogin ();
120
122
} else {
121
- showErrorTost (' Invalid code' );
123
+ showErrorTost (t ( ' Invalid code' ) );
122
124
}
123
125
}
124
126
Original file line number Diff line number Diff line change @@ -78,7 +78,9 @@ import { Button, LinkButton } from '@/afcl';
78
78
import Vue2FACodeInput from ' @loltech/vue3-2fa-code-input' ;
79
79
import VOtpInput from " vue3-otp-input" ;
80
80
import adminforth from ' @/adminforth' ;
81
+ import { useI18n } from ' vue-i18n' ;
81
82
83
+ const { t } = useI18n ();
82
84
83
85
const code = ref (null );
84
86
const handleOnComplete = (value ) => {
@@ -125,7 +127,7 @@ function parseJwt(token) {
125
127
126
128
function onCopyClick(){
127
129
navigator .clipboard .writeText (totp .value .newSecret );
128
- adminforth .alert ({message: ' Copied to clipboard' , variant: ' success' })
130
+ adminforth .alert ({message: t ( ' Copied to clipboard' ) , variant: ' success' })
129
131
}
130
132
131
133
onMounted (async () => {
@@ -170,7 +172,7 @@ async function sendCode (value) {
170
172
if (resp .allowedLogin ){
171
173
await user .finishLogin ()
172
174
} else {
173
- showErrorTost (' Invalid code' );
175
+ showErrorTost (t ( ' Invalid code' ) );
174
176
}
175
177
}
176
178
@@ -197,7 +199,7 @@ const handleSkip = async () => {
197
199
if (resp .allowedLogin ){
198
200
await user .finishLogin ()
199
201
} else {
200
- showErrorTost (' Something went wrong' );
202
+ showErrorTost (t ( ' Something went wrong' ) );
201
203
}
202
204
}
203
205
</script >
You can’t perform that action at this time.
0 commit comments