File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/auth Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -68,16 +68,16 @@ fun fetchToken(call: ApplicationCall) {
68
68
else -> {
69
69
// TODO 后续兼容JWT校验
70
70
71
- // 1. try to get token from cookies
72
- possibleTokenKey.firstNotNullOfOrNull { call.request.cookies[it] } ? :
73
-
74
- // 2. try to get token from headers
71
+ // 1. try to get token from headers
75
72
possibleTokenKey.firstNotNullOfOrNull {
76
73
call.request.headers[it]?.let { auth ->
77
74
if (auth.startsWith(" Bearer" )) auth.split(" " )[1 ] else auth
78
75
}
79
76
} ? :
80
77
78
+ // 2. try to get token from cookies
79
+ possibleTokenKey.firstNotNullOfOrNull { call.request.cookies[it] } ? :
80
+
81
81
// 3. try to get token from query parameters
82
82
possibleTokenKey.firstNotNullOfOrNull { call.request.queryParameters[it] }
83
83
You can’t perform that action at this time.
0 commit comments