From 6132e00c5ec4220551aa022757384045ddfa3b94 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 10 Mar 2022 17:15:04 +0400 Subject: [PATCH] #3 -- add login error page --- data/db.mv.db | Bin 45056 -> 57344 bytes .../ulstu/configuration/MvcConfiguration.java | 1 + .../configuration/SecurityConfiguration.java | 1 + src/main/resources/templates/login.html | 12 +----- src/main/resources/templates/loginError.html | 40 ++++++++++++++++++ 5 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 src/main/resources/templates/loginError.html diff --git a/data/db.mv.db b/data/db.mv.db index 07fbdd344e7fa5609578eaf31df93e107f926799..bd8aacfce738bf528d59c0e7f43e91b545f72221 100644 GIT binary patch literal 57344 zcmeHQeT*B&btg}xBcFVdPPVKs%O0`*&`AtUE_av9Yl@gh@^rNBc+!z~lF~Mp<#Ku2 zgh!tFaZ&O|>W_RNNZPm!ni{BEpiR@DK-wB<+&FRU7zGNXMS}8-HZAg3{%aGo@IUQ8 zEduw=*Y5CBC+W_%l#z{F&hF04o8P>7Gw^?WqML?UvGruQQg5uAt?5{J({41KdX2nTsoE{;s@<42D+$Gp zo65LP{*wqu1SA3y0f~S_Kq4R!kO)WwBmxoviGW1lT}NO}>i_S0A4mcu0ulj*mI^5rfOM>9}S_!!`R_Yg!9$ zm}_=(I;Mpi^?GYsF%@tWh(--tQRCs3vu;l(bxYOElIIlwC2u&jbiG|`O-Iqr{=?n{ z4~4O{@zD{JD5CP-SeO?ro>fEPXzY{?+%U!_XY0>P6YP{4+IYe zAy@F;;C;cv!TWao&eXf9Ql zLysjAmSP);SgfKYl~_zw)mU6FmF-fgoG?md-HOJ_W;A9-O-nTsC0kXrvTCSCvXqG1 zdMWxCN@W&u`N_bqAT+VbNJ*#CbJ+|kre@}|D0E?YW5FV65Ax#E0J&*7eV z40$RxI^ccf4fT6W*455R&xVxLO5GN{(=ub>AtsiPS3lRU_5Ekz$ zXIoeUC0$sLsCr}g4N$7-+kL-kP;ty4I;eTC;p#%DXL&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@g}g!p`GHHmMy%C(vp0V(+;syA5-eScn>>ueg4A|b;~A7*eMvL?n1=E{Id?G zz>mSg!jy9`TLR zq4yU*Jo$NOrouW53s(yZH|N(a2n%;H)LG%8GG#n$uk? zw-J+5QQ085C~AkAyB;fVu(}f5V6_JZ>+Ny|>(#(u{d$|hdZ*N2Z5IY>w=h^Q1zq}@ zqRc(tq{PW@V*aL<$f2j|y(c=A7IEk)-=(5owP?SFR!f)+D1V)p{h@+78?v9#>eHm^ z3(pvqDvn?wRZ5>{#2IW>c3f_Sdj zAYQNSi&C#gJDGbuiim|${qH3lIe`qbp4X_hGo({(=ZI=MM^s!HGN`sQR7g{8XE05* zouLfXc8-win*xSR75Umuk#0cK*LI4y*JC3Av1sBR0&d_J*gd!t>IglMFEQjp%>U*I b$>wQ^Bq^Z=>7fR>rfus~f-2kE+7f>OD7(Sd diff --git a/src/main/java/ru/ulstu/configuration/MvcConfiguration.java b/src/main/java/ru/ulstu/configuration/MvcConfiguration.java index 799c414..9154347 100644 --- a/src/main/java/ru/ulstu/configuration/MvcConfiguration.java +++ b/src/main/java/ru/ulstu/configuration/MvcConfiguration.java @@ -21,6 +21,7 @@ public class MvcConfiguration implements WebMvcConfigurer { @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/login"); + registry.addViewController("/loginError"); registry.addViewController("/index"); registry.addViewController("/admin"); registry.addViewController("/editNews"); diff --git a/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java b/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java index f81bc87..8376327 100644 --- a/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java +++ b/src/main/java/ru/ulstu/configuration/SecurityConfiguration.java @@ -53,6 +53,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { .and() .formLogin() .loginPage("/login") + .failureUrl("/loginError") .successHandler(authenticationSuccessHandler) .permitAll() .and() diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index 52f3558..20cb039 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -13,11 +13,6 @@
-
@@ -30,12 +25,7 @@
- - +
diff --git a/src/main/resources/templates/loginError.html b/src/main/resources/templates/loginError.html new file mode 100644 index 0000000..1d08df3 --- /dev/null +++ b/src/main/resources/templates/loginError.html @@ -0,0 +1,40 @@ + + + + + + +
+
+ +
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ + \ No newline at end of file