Merge commit 'a18d8e1d3dd02c8978033f09563d2ec9341926c7' into work/reports-ui
This commit is contained in:
@@ -31,7 +31,7 @@ class SecurityConfiguration {
|
||||
.permitAll()
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.formLogin(form -> form.defaultSuccessUrl("/", true))
|
||||
.formLogin(form -> form.loginPage("/login").defaultSuccessUrl("/", true))
|
||||
.logout(logout -> logout.logoutSuccessUrl("/login?logout"))
|
||||
.addFilterBefore(bootstrapAccessFilter, AuthorizationFilter.class)
|
||||
.build();
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.lab.labtimesheet.feature.account.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
class AuthenticationController {
|
||||
@GetMapping("/login")
|
||||
String login() {
|
||||
return "accounts/login";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<!doctype html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head><meta charset="utf-8"><title>Sign in · Lab Timesheet</title></head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Sign in</h1>
|
||||
<p th:if="${param.error}">Invalid email or password</p>
|
||||
<p th:if="${param.logout}">You have signed out</p>
|
||||
<p th:if="${param.activated}">Your account is active. Sign in to continue.</p>
|
||||
<form method="post" th:action="@{/login}">
|
||||
<label for="username">Email</label>
|
||||
<input id="username" name="username" type="email" autocomplete="username" required autofocus>
|
||||
<label for="password">Password</label>
|
||||
<input id="password" name="password" type="password" autocomplete="current-password" required>
|
||||
<button type="submit">Sign in</button>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user