Skip to content

Commit

Permalink
Fix token regex for recent Synapse
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Apr 20, 2024
1 parent 5093b4b commit 0ecb214
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/matrix-identity-server/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Authenticate = (
db: IdentityServerDb,
logger: TwakeLogger
): AuthenticationFunction => {
const tokenRe = /^Bearer ([a-zA-Z0-9_]+)$/
const tokenRe = /^Bearer (\S+)$/
return (req, res, callback) => {
let token: string | null = null
if (req.headers.authorization != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const auth: expressAppHandler = (
res: Response,
next: NextFunction
): void => {
const tokenRe = /^Bearer ([a-zA-Z0-9]{64})$/
const tokenRe = /^Bearer (\S+)$/
let token = null
if (req.headers?.authorization != null) {
const re = req.headers.authorization.match(tokenRe)
Expand Down

0 comments on commit 0ecb214

Please sign in to comment.