Set the region info from updated backend API

This commit is contained in:
jetli 2024-06-19 00:18:00 +08:00
parent 0435dd00e6
commit ef10662102

View File

@ -5,13 +5,8 @@
<div class="form-group"> <div class="form-group">
<div class="input-group-container"> <div class="input-group-container">
<div class="form-floating"> <div class="form-floating">
<input <input class="input-email" id="inputCode" type="text" :placeholder="'Code sent to your email'"
class="input-email" v-model="code" />
id="inputCode"
type="text"
:placeholder="'Code sent to your email'"
v-model="code"
/>
<label for="inputCode">Authenticaion Code Sent To Your Email</label> <label for="inputCode">Authenticaion Code Sent To Your Email</label>
</div> </div>
<button type="submit" class="btn-start">SIGN IN</button> <button type="submit" class="btn-start">SIGN IN</button>
@ -38,13 +33,14 @@ export default {
data() { data() {
return { return {
code: null, code: null,
message: null message: null,
preferred_region: null
} }
}, },
components: {}, components: {},
created() {}, created() { },
mounted() { mounted() {
if (this.mnx_IsKeepUserSignedIn() && this.mnx_isUserAuthenticated()) { if (this.mnx_IsKeepUserSignedIn() && this.mnx_isUserAuthenticated()) {
this.mnx_navAfterSignedin() this.mnx_navAfterSignedin()
@ -65,6 +61,7 @@ export default {
UserAuthApi.signinWithEmailAndCode(this.email, this.code, window.location.host) UserAuthApi.signinWithEmailAndCode(this.email, this.code, window.location.host)
.then((response) => { .then((response) => {
let signinAction = response.data.signin_result let signinAction = response.data.signin_result
this.preferred_region = response.data.preferred_region
switch (signinAction) { switch (signinAction) {
case signinActionEnum.VERIFY_EMAIL_WITH_AUTH_CODE: case signinActionEnum.VERIFY_EMAIL_WITH_AUTH_CODE:
this.message = 'Invalid auth code' this.message = 'Invalid auth code'
@ -103,5 +100,4 @@ export default {
// .btn-start { // .btn-start {
// @extend .proceed-button; // @extend .proceed-button;
// @extend .ms-1; // @extend .ms-1;
// } // }</style>
</style>