Shamrock: fix #186

This commit is contained in:
whitechi72 2024-01-04 00:30:36 +08:00
parent 2645e8f451
commit 2c1bd9e726
2 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,8 @@ object DashboardInitializer {
url("http://127.0.0.1:$servicePort/get_account_info")
val token = ShamrockConfig.getToken(context)
if (token.isNotBlank()) {
parameter("token", token)
//header("Authorization", "Bearer $token")
parameter("access_token", token)
}
}.let {
if (it.status == HttpStatusCode.OK) {

View File

@ -20,6 +20,9 @@ private suspend fun ApplicationCall.checkToken() {
?: fetchOrNull("access_token")?.let {
URLDecoder.decode(it)
}
?: fetchOrNull("token")?.let {
URLDecoder.decode(it)
}
?: throw ErrorTokenException
if (accessToken.startsWith("Bearer ", ignoreCase = true)) {
accessToken = accessToken.substring(7)