Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add temporal welcome page after login #74

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sell-bff/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http)
return http
.authorizeExchange(auth -> auth
.pathMatchers("/health").permitAll()
.anyExchange().hasAnyRole("ADMIN"))
.anyExchange().authenticated())
.oauth2Login(Customizer.withDefaults())
.httpBasic(ServerHttpSecurity.HttpBasicSpec::disable)
.formLogin(ServerHttpSecurity.FormLoginSpec::disable)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.fjb.sellbff.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping
public class HealthController {
@GetMapping
public String healthController() {
return "index";
}
}
52 changes: 52 additions & 0 deletions sell-bff/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<title>Hello, Matcha 🍃🍃</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
font-family: 'Roboto', sans-serif;
}
.container {
text-align: center;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
h1 {
color: #3EB90E; /* Bootstrap Danger color */
}
p {
color: #1A15B6; /* Bootstrap Info color */
}
a {
display: inline-block;
margin-top: 10px;
padding: 10px 15px;
background-color: #5cb85c; /* Bootstrap Success color */
color: white;
text-decoration: none;
border-radius: 5px;
}
a:hover {
background-color: #4cae4c; /* Darker green on hover */
}
</style>
</head>
<body>
<div class="container">
<h1>Welcome to Matcha Store 🍃🍃🍃</h1>
<p>Service is not available now!</p>
<p>Go to Swagger UI to check your API endpoints! Thank you!</p>
<a href="http://localhost:8090/swagger-ui">Swagger UI</a>
</div>
</body>
</html>
Loading