Commit e8f5db42 authored by Mathieu's avatar Mathieu
Browse files

Fix logout process

parent 2833e6c0
......@@ -153,7 +153,7 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
}
private def deleteCookie(tokenData: TokenData) = {
response.setHeader("Set-Cookie", s"${tokenData.tokenType.cookieKey}=;Expires=${dateFormat.format(0L)}")
response.addHeader("Set-Cookie", s"${tokenData.tokenType.cookieKey}=;Expires=${dateFormat.format(0L)}")
}
private def getResource(path: String, requestContentType: String) = {
......@@ -200,22 +200,21 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
getResource(request.uri.getPath, request.getContentType)
}
get("/") {
connectionAppRedirection
}
get("/logout") {
withAccesToken { accessTokenData =>
withRefreshToken {refreshTokenData =>
deleteCookie(refreshTokenData)
deleteCookie(accessTokenData)
Ok()
}
Ok()
redirect("/")
}
redirect("/")
}
get("/") {
connectionAppRedirection
}
def connectionHtml = {
contentType = "text/html"
tags.html(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment