add Session flows (1x)

- fix APIRoutes
This commit is contained in:
dalbodeule 2024-08-08 17:30:42 +09:00
parent 369d5491e8
commit 561ab188b2
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65
2 changed files with 3 additions and 2 deletions

View File

@ -87,9 +87,9 @@ val server = embeddedServer(Netty, port = 8080, ) {
}
}.body()
call.sessions.set(userInfo.response?.let { it1 ->
call.sessions.set(userInfo.response?.let { profile ->
UserSession(state,
it1.id, it1.nickname, it1.profile_image)
profile.id, profile.nickname, profile.profile_image)
})
redirects[state]?.let { redirect ->

View File

@ -72,6 +72,7 @@ fun Routing.apiRoutes() {
call.respondText("No session found", status = HttpStatusCode.NotFound)
return@get
}
println(session)
val user = UserService.getUserWithNaverId(session.id.toLong())
if(user == null) {
call.respondText("No session found", status = HttpStatusCode.NotFound)