rajt 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/auth/token.ts +8 -8
package/package.json
CHANGED
package/src/auth/token.ts
CHANGED
|
@@ -16,14 +16,14 @@ export class Token {
|
|
|
16
16
|
const header = c.cx.req.header(this.#name) || c.cx.req.header('HTTP_AUTHORIZATION') || c.cx.req.header('REDIRECT_HTTP_AUTHORIZATION') || null
|
|
17
17
|
|
|
18
18
|
if (header) {
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
const pos = header.toLowerCase().indexOf(this.#prefix.toLowerCase())
|
|
20
|
+
if (pos < 0) return header
|
|
21
|
+
|
|
22
|
+
let token = header.slice(pos + this.#prefix.length).trim()
|
|
23
|
+
const commaPos = token.indexOf(',')
|
|
24
|
+
if (commaPos > -1) token = token.slice(0, commaPos).trim()
|
|
25
|
+
|
|
26
|
+
return token
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
return null
|