mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: fix #186
This commit is contained in:
parent
2645e8f451
commit
2c1bd9e726
@ -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) {
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user