File tree 4 files changed +14
-3
lines changed
4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2,5 +2,7 @@ import './vaadin-featureflags.ts';
2
2
3
3
import './index' ;
4
4
5
+ import '@vaadin/flow-frontend/VaadinDevmodeGizmo.js' ;
6
+
5
7
import { applyTheme } from './theme' ;
6
8
applyTheme ( document ) ;
Original file line number Diff line number Diff line change 3
3
import java .util .ArrayList ;
4
4
import java .util .List ;
5
5
import life .qbic .identityaccess .domain .user .EmailAddress ;
6
+ import life .qbic .identityaccess .domain .user .EmailAddress .EmailValidationException ;
6
7
import life .qbic .identityaccess .domain .user .User ;
7
8
import life .qbic .identityaccess .domain .user .UserRepository ;
8
9
import org .springframework .beans .factory .annotation .Autowired ;
@@ -24,7 +25,15 @@ public class UserDetailsServiceImpl implements UserDetailsService {
24
25
25
26
@ Override
26
27
public UserDetails loadUserByUsername (String username ) throws UsernameNotFoundException {
27
- var user = userRepository .findByEmail (EmailAddress .from (username ));
28
+ EmailAddress email ;
29
+ // Check if the email address is valid
30
+ try {
31
+ email = EmailAddress .from (username );
32
+ } catch (EmailValidationException e ) {
33
+ throw new UsernameNotFoundException ("Cannot find user" );
34
+ }
35
+ // Then search for a user with the provided email address
36
+ var user = userRepository .findByEmail (email );
28
37
return new QbicUserDetails (
29
38
user .orElseThrow (() -> new UsernameNotFoundException ("Cannot find user" )));
30
39
}
Original file line number Diff line number Diff line change 15
15
import org .springframework .beans .factory .annotation .Autowired ;
16
16
17
17
@ PageTitle ("Hello World" )
18
- @ Route (value = "hello " , layout = MainLayout .class )
18
+ @ Route (value = "" , layout = MainLayout .class )
19
19
@ PermitAll
20
20
public class HelloWorldView extends VerticalLayout {
21
21
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ private void addListener() {
83
83
84
84
private void onLoginSucceeded () {
85
85
clearNotifications ();
86
- UI .getCurrent ().navigate ("/hello " );
86
+ UI .getCurrent ().navigate ("/" );
87
87
}
88
88
89
89
@ Override
You can’t perform that action at this time.
0 commit comments