Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GrowBros
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tomato
GrowBros
Commits
aae37b69
Commit
aae37b69
authored
1 year ago
by
Lukas Karsch
Browse files
Options
Downloads
Patches
Plain Diff
#35
fix import issue
parent
8b0e3401
No related branches found
No related tags found
1 merge request
!18
Resolve: "fix: import issues for user repository after refactoring"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/hdm/mi/growbros/auth/AuthenticationService.java
+2
-1
2 additions, 1 deletion
...main/java/hdm/mi/growbros/auth/AuthenticationService.java
src/main/java/hdm/mi/growbros/security/ApplicationConfig.java
+4
-5
4 additions, 5 deletions
...main/java/hdm/mi/growbros/security/ApplicationConfig.java
with
6 additions
and
6 deletions
src/main/java/hdm/mi/growbros/auth/AuthenticationService.java
+
2
−
1
View file @
aae37b69
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
src/main/java/hdm/mi/growbros/security/ApplicationConfig.java
+
4
−
5
View file @
aae37b69
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
r
epository
;
private
final
UserRepository
userR
epository
;
@Bean
public
UserDetailsService
userDetailsService
()
{
return
username
->
r
epository
.
findByEmail
(
username
)
.
orElseThrow
(()
->
new
UsernameNotFoundException
(
"User not found
"
));
return
username
->
userR
epository
.
findByEmail
(
username
)
.
orElseThrow
(()
->
new
UsernameNotFoundException
(
"User not found
for username: "
+
username
));
}
/**
* Fetcht die Benutzer Daten und decodiert das Passwort.
* @return
*/
@Bean
public
AuthenticationProvider
authenticationProvider
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment