Skip to content
Snippets Groups Projects
Commit 99e98d63 authored by Joshua Grey's avatar Joshua Grey
Browse files

Merge branch 'logout' into 'dev'

Logout

See merge request c22001956/group-6-client-project-2023!4
parents 6c9ddfeb 7d821fd8
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,13 @@ public class SecurityConfig {
.loginProcessingUrl("/processLogin")
.successHandler(new CustomAuthenticationSuccessHandler())
.failureUrl("/login?error")
);
)
.logout(logout -> logout
.permitAll()
.logoutUrl("/logout")
.logoutSuccessUrl("/login?logout")
)
;
return httpSecurity.build();
}
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Logged in</title>
</head>
<body>
Login complete
<!-- To be replaced by header -->
<form th:action="@{/logout}" th:method="post">
<input type="submit" name="logout" value="logout"/>
<input name="${_csrf.parameterName}"
type="hidden"
value="${_csrf.token}"/>
</form>
</body>
</html>
\ No newline at end of file
......@@ -6,5 +6,15 @@
</head>
<body>
Login complete
<!-- To be replaced by header -->
<form th:action="@{/logout}" th:method="post">
<input type="submit" name="logout" value="logout"/>
<input name="${_csrf.parameterName}"
type="hidden"
value="${_csrf.token}"/>
</form>
</body>
</html>
\ No newline at end of file
......@@ -11,12 +11,12 @@
</head>
<body>
<section class="d-flex flex-column align-items-center py-5">
<div th:if="${param.logout}">
Successfully logged out
</div>
<div th:if="${param.logout}" class="mb-3 font-weight-bold small text-success">
Successfully logged out
</div>
<section class="d-flex flex-column align-items-center py-5">
<form method="post" th:action="@{/processLogin}">
<div class="mb-3">
......
......@@ -6,5 +6,13 @@
</head>
<body>
Login complete
<!-- To be replaced by header -->
<form th:action="@{/logout}" th:method="post">
<input type="submit" name="logout" value="logout"/>
<input name="${_csrf.parameterName}"
type="hidden"
value="${_csrf.token}"/>
</form>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment