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 ...@@ -153,7 +153,7 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
} }
private def deleteCookie(tokenData: TokenData) = { 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) = { private def getResource(path: String, requestContentType: String) = {
...@@ -200,22 +200,21 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra ...@@ -200,22 +200,21 @@ class ConnectServlet(arguments: ConnectServer.ServletArguments) extends Scalatra
getResource(request.uri.getPath, request.getContentType) getResource(request.uri.getPath, request.getContentType)
} }
get("/") {
connectionAppRedirection
}
get("/logout") { get("/logout") {
withAccesToken { accessTokenData => withAccesToken { accessTokenData =>
withRefreshToken {refreshTokenData => withRefreshToken {refreshTokenData =>
deleteCookie(refreshTokenData) deleteCookie(refreshTokenData)
deleteCookie(accessTokenData) deleteCookie(accessTokenData)
Ok() redirect("/")
} }
Ok() redirect("/")
} }
} }
get("/") {
connectionAppRedirection
}
def connectionHtml = { def connectionHtml = {
contentType = "text/html" contentType = "text/html"
tags.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