We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent beecd39 commit a490519Copy full SHA for a490519
oauth2-server-core/src/main/java/nl/myndocs/oauth2/request/auth/BasicAuth.kt
@@ -8,16 +8,13 @@ object BasicAuth {
8
var password: String? = null
9
10
if (authorization.startsWith("basic ", true)) {
11
+ val basicAuthorizationString = String(Base64.getDecoder().decode(authorization.substring(6)))
12
- val basicAuthorizationString = String(
13
- Base64.getDecoder().decode(authorization.substring(6))
14
- )
15
-
16
- val splittedString = basicAuthorizationString.split(":")
17
18
- if (splittedString.size == 2) {
19
- username = splittedString[0]
20
- password = splittedString[1]
+ with(basicAuthorizationString.split(":")) {
+ if (this.size == 2) {
+ username = this[0]
+ password = this[1]
+ }
21
}
22
23
0 commit comments