Skip to content

Commit 41b8aee

Browse files
Fix: Add api/v2/login to allways allow login (#376)
* add api/v2/login to allways allow login * change /v2/ to /v1/ for instant fix
1 parent a5a9635 commit 41b8aee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.wafflestudio.csereal.common.controller
2+
3+
import jakarta.servlet.http.HttpServletResponse
4+
import org.springframework.beans.factory.annotation.Value
5+
import org.springframework.context.annotation.Profile
6+
import org.springframework.web.bind.annotation.GetMapping
7+
import org.springframework.web.bind.annotation.RestController
8+
9+
@Profile("!test")
10+
@RestController
11+
class LoginController(
12+
@Value("\${login-page}")
13+
private val loginPage: String
14+
) {
15+
@GetMapping("/api/v1/login")
16+
fun redirectToLoginURL(response: HttpServletResponse) {
17+
val redirectUrl = "$loginPage/oauth2/authorization/idsnucse"
18+
response.sendRedirect(redirectUrl)
19+
}
20+
}

0 commit comments

Comments
 (0)