Skip to content

Commit 41f29cb

Browse files
Corrige login-wizard para exibir mensagens e deixar padrão o botão ENTRAR
1 parent 82517e0 commit 41f29cb

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

components/login-wizard/script.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ app.component('login-wizard', {
8888
};
8989

9090
return await api.POST($MAPAS.baseURL + "autenticacao/verify", dataPost).then(response => response.json().then(dataReturn => {
91-
console.log(dataReturn.result)
9291
if (dataReturn.error) {
9392
this.throwErrors(dataReturn.data);
9493
} else {
@@ -189,7 +188,7 @@ app.component('login-wizard', {
189188
throwErrors(errors) {
190189
const messages = useMessages();
191190

192-
if (this.recaptchaResponse !== '') {
191+
if (this.recaptchaShown && this.recaptchaResponse !== '') {
193192
grecaptcha.reset();
194193
this.expiredCaptcha();
195194
}

components/login-wizard/template.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<div class="login__buttons">
5757
<button v-if="!showPassword && !passwordResetRequired && !userNotFound" class="button button--primary button--large button--md" type="submit"> <?= i::__('Próximo') ?> </button>
58-
<button v-if="showPassword && !passwordResetRequired" class="button button--primary button--large button--md" type="button" @click="doLogin"> <?= i::__('Entrar') ?> </button>
58+
<button v-if="showPassword && !passwordResetRequired" class="button button--primary button--large button--md" type="submit" @click="doLogin"> <?= i::__('Entrar') ?> </button>
5959
<button v-if="passwordResetRequired" class="button button--primary button--large button--md" @click="recoveryRequest = true"> <?= i::__('Gerar nova senha') ?> </button>
6060
<button v-if="passwordResetRequired || showPassword" class="button button--secondary button--large button--md" @click="resetLoginState"> <?= i::__('Voltar') ?> </button>
6161
</div>
@@ -137,4 +137,4 @@
137137
</div>
138138
</div>
139139
</div>
140-
</div>
140+
</div>

views/auth/multiple-local.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,15 @@
1212
$this->jsObject['recoveryMode']['token'] = $_GET['t'];
1313
}
1414

15-
$flag = 'login';
16-
17-
$templates = [
18-
'login' => function () use ($configs) {
19-
return "<login config='$configs'></login>";
20-
},
21-
22-
'login-wizard' => function () use ($configs) {
23-
return "<login-wizard config='$configs'></login-wizard>";
15+
$loginMode = 'login';
16+
if (isset($config['wizard'])) {
17+
if ($config['wizard'] == 'true') {
18+
$loginMode = 'login-wizard';
2419
}
25-
];
26-
27-
if ($config['wizard'] == true){
28-
$flag = 'login-wizard';
2920
}
3021

31-
$this->import($flag);
22+
$this->import($loginMode);
3223

33-
echo $templates[$flag]();
34-
?>
24+
echo "<$loginMode config='$configs'></$loginMode>"
3525

26+
?>

0 commit comments

Comments
 (0)