From aae37b691fece1e09f713d0054620f02edda6b85 Mon Sep 17 00:00:00 2001
From: Lukas Karsch <lukas.karsch03@gmail.com>
Date: Wed, 6 Dec 2023 16:44:36 +0100
Subject: [PATCH] #35 fix import issue

---
 .../java/hdm/mi/growbros/auth/AuthenticationService.java | 3 ++-
 .../java/hdm/mi/growbros/security/ApplicationConfig.java | 9 ++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/hdm/mi/growbros/auth/AuthenticationService.java b/src/main/java/hdm/mi/growbros/auth/AuthenticationService.java
index acecf64..77c217b 100644
--- a/src/main/java/hdm/mi/growbros/auth/AuthenticationService.java
+++ b/src/main/java/hdm/mi/growbros/auth/AuthenticationService.java
@@ -2,7 +2,7 @@ package hdm.mi.growbros.auth;
 
 import hdm.mi.growbros.models.user.Role;
 import hdm.mi.growbros.models.user.User;
-import hdm.mi.growbros.models.user.UserRepository;
+import hdm.mi.growbros.repositories.UserRepository;
 import hdm.mi.growbros.security.JwtService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.authentication.AuthenticationManager;
@@ -17,6 +17,7 @@ public class AuthenticationService {
     private final PasswordEncoder passwordEncoder;
     private final JwtService jwtService;
     private final AuthenticationManager authenticationManager;
+
     /**
      * Ermöglicht es einen User zu erstellen und diesen in der Datenbank zu registrieren
      * und daraus den Token zu erstellen.
diff --git a/src/main/java/hdm/mi/growbros/security/ApplicationConfig.java b/src/main/java/hdm/mi/growbros/security/ApplicationConfig.java
index 5c2d13d..701026d 100644
--- a/src/main/java/hdm/mi/growbros/security/ApplicationConfig.java
+++ b/src/main/java/hdm/mi/growbros/security/ApplicationConfig.java
@@ -1,6 +1,6 @@
 package hdm.mi.growbros.security;
 
-import hdm.mi.growbros.models.user.UserRepository;
+import hdm.mi.growbros.repositories.UserRepository;
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -16,16 +16,15 @@ import org.springframework.security.crypto.password.PasswordEncoder;
 @Configuration
 @RequiredArgsConstructor
 public class ApplicationConfig {
-    private final UserRepository repository;
+    private final UserRepository userRepository;
     @Bean
     public UserDetailsService userDetailsService() {
-        return username -> repository.findByEmail(username)
-                .orElseThrow(() -> new UsernameNotFoundException("User not found"));
+        return username -> userRepository.findByEmail(username)
+                .orElseThrow(() -> new UsernameNotFoundException("User not found for username: " + username));
     }
 
     /**
      * Fetcht die Benutzer Daten und decodiert das Passwort.
-     * @return
      */
     @Bean
     public AuthenticationProvider authenticationProvider() {
-- 
GitLab