change passwords
This commit is contained in:
parent
141369cdec
commit
2b880d232a
@ -11,6 +11,7 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@ -39,6 +40,8 @@ public class EmployeeController {
|
|||||||
public EmployeeDTO info(@RequestParam final String login) {
|
public EmployeeDTO info(@RequestParam final String login) {
|
||||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
String recipientLogin = authentication.getName();
|
String recipientLogin = authentication.getName();
|
||||||
|
var a = new BCryptPasswordEncoder();
|
||||||
|
System.out.println(a.encode("wordpass"));
|
||||||
return employeeService.getEmployeeDTO(login, recipientLogin);
|
return employeeService.getEmployeeDTO(login, recipientLogin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
INSERT INTO employee (id, login, password, name, photo, position, last_visit, role, is_banned)
|
INSERT INTO employee (id, login, password, name, photo, position, last_visit, role, is_banned)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'pivanov', '$2a$10$ciGeZy83rnnmeVDJylnAAuqg2z3ZfXNIS.8PYwRQdPrbguAybtUbe', 'Иванов Петр Федорович', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Разработчик', '2024-02-12T08:30', 'USER', false),
|
(1, 'pivanov', '$2a$10$1Ol1/IKIok1WTeuIsjr/v.foHHigFFX0SlJNo4ILLCuXGu8ruqQzG', 'Иванов Петр Федорович', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Разработчик', '2024-02-12T08:30', 'USER', false),
|
||||||
(2, 'ipetrov', 'cringe', 'Петров Иван Константинович', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Аналитик', '2024-02-13T08:35', 'ADMIN', false),
|
(4, 'afedorov', '$2a$10$SykNGIZ6Crt8o60DnGQVIes2r4SEvivw3CcHZg.INHojXpioc8LNS', 'Федоров Александр Сергеевич', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Тестировщик', '2024-02-12T08:36', 'ADMIN', false);
|
||||||
(3, 'asemenov', 'pupupu', 'Семенов Анатолий Анатольевич', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Разработчик', '2024-02-13T08:31', 'USER', false),
|
|
||||||
(4, 'afedorov', '$2a$10$4tbL.Kp1e4TB1Luq86hzAeAdDgBLoqH3Kh0GaR5RmkNni5lzre3oO', 'Федоров Александр Сергеевич', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Тестировщик', '2024-02-12T08:36', 'ADMIN', false);
|
|
||||||
|
|
||||||
INSERT INTO code (value)
|
INSERT INTO code (value)
|
||||||
VALUES
|
VALUES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user