|
Last change
on this file was 81cdf2d, checked in by Nikola Janev <nikolajanev57@…>, 10 days ago |
|
initial commit
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | package com.nikola.web3ednevnikbackend.config.security;
|
|---|
| 2 |
|
|---|
| 3 | import org.jspecify.annotations.Nullable;
|
|---|
| 4 | import org.springframework.security.core.GrantedAuthority;
|
|---|
| 5 | import org.springframework.security.core.userdetails.UserDetails;
|
|---|
| 6 |
|
|---|
| 7 | import java.util.Collection;
|
|---|
| 8 | import java.util.UUID;
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | public class CustomUserDetails implements UserDetails {
|
|---|
| 12 | private final UUID id;
|
|---|
| 13 | private final String e_posta;
|
|---|
| 14 | private final String lozinka;
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | private final Collection<? extends GrantedAuthority> authorities;
|
|---|
| 18 |
|
|---|
| 19 | public CustomUserDetails(UUID id, String e_posta,
|
|---|
| 20 | String lozinka,
|
|---|
| 21 | Collection<? extends GrantedAuthority> authorities) {
|
|---|
| 22 | this.id = id;
|
|---|
| 23 | this.e_posta = e_posta;
|
|---|
| 24 | this.lozinka = lozinka;
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | this.authorities = authorities;
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | @Override
|
|---|
| 31 | public Collection<? extends GrantedAuthority> getAuthorities() {
|
|---|
| 32 | return authorities;
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | @Override
|
|---|
| 36 | public @Nullable String getPassword() {
|
|---|
| 37 | return lozinka;
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | @Override
|
|---|
| 41 | public String getUsername() {
|
|---|
| 42 | return e_posta;
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | public UUID getId() {
|
|---|
| 46 | return id;
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.