mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
debug discord login
This commit is contained in:
parent
977ca3e69f
commit
eab30ff5c3
@ -21,9 +21,7 @@ import io.ktor.server.sessions.*
|
||||
import io.ktor.server.websocket.*
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import space.mori.chzzk_bot.common.models.User
|
||||
import space.mori.chzzk_bot.common.services.UserService
|
||||
import space.mori.chzzk_bot.common.utils.getUserInfo
|
||||
import space.mori.chzzk_bot.webserver.routes.*
|
||||
import java.time.Duration
|
||||
|
||||
@ -126,6 +124,11 @@ val server = embeddedServer(Netty, port = 8080, ) {
|
||||
}
|
||||
call.respondRedirect(getFrontendURL(""))
|
||||
}
|
||||
}
|
||||
authenticate("auth-oauth-discord") {
|
||||
get("/login/discord") {
|
||||
|
||||
}
|
||||
get("/discord/callback") {
|
||||
val principal = call.principal<OAuthAccessTokenResponse.OAuth2>()
|
||||
val session = call.sessions.get<UserSession>()
|
||||
@ -194,7 +197,7 @@ fun stop() {
|
||||
}
|
||||
|
||||
fun getFrontendURL(path: String)
|
||||
= "${if(dotenv["FRONTEND_HTTPS"].toBoolean()) "https://" else "http://" }${dotenv["FRONTEND"]}${path}";
|
||||
= "${if(dotenv["FRONTEND_HTTPS"].toBoolean()) "https://" else "http://" }${dotenv["FRONTEND"]}${path}"
|
||||
|
||||
@Serializable
|
||||
data class UserSession(
|
||||
|
Loading…
x
Reference in New Issue
Block a user