I have a LoginView which I basically copied from the bakery starter project.
When I run the bakery app and try to login with wrong credentials, there appears an additional div with an error message.
However, this error message div does not appear in my view. I have since adapted the template to our Corporate Design, but I can remember that this issue already existed when the two files LoginView.java and login-view.html were still exact copies from the bakery app. I double checked that .error is not just hidden by my own css - the div.error is not existing in the DOM.
Debugging the LoginView when visiting /login?error (visiting login?error=true is the same) shows that it does not recognize any queryParameters! --> Why?
My (Spring) Security Configuration is the same too where the login is concerned:
.and()
.formLogin()
.loginPage(("/login")).permitAll()
.loginProcessingUrl("/login")
.failureUrl("/login?error")
Edit: as asked for in the comments, I'll add the relevant part of the template. However, the error is 100% not in the template - as I can see with debugging that the error occurs already in the LoginView.java in the afterNavigation method.
<dom-module id="login-view">
<template>
<style include="shared-styles">
.....
</style>
.....
<template is="dom-if" if="[[error]]">
<div class="error">
<iron-icon icon="vaadin:exclamation-circle-o" class="error__icon"></iron-icon>
<p class="error__text">
Der Benutzername und/oder das Passwort stimmt nicht. Bitte überprüfe deine Angaben und versuche es erneut.
</p>
</div>
</template>
....
</template>
<script>
class LoginView extends Polymer.GestureEventListeners(Polymer.Element) {
static get is() {
return 'login-view';
}
static get properties() {
return {
error: {
type: Boolean,
value: false
}
};
}
......
}
window.customElements.define(LoginView.is, LoginView);
</script>
</dom-module>

