2025-09-02 21:43:00 +10:00
|
|
|
export default function () {
|
|
|
|
|
return (req, res, next) => {
|
2020-02-19 15:55:06 +11:00
|
|
|
if (req.headers.authorization) {
|
2025-09-02 21:43:00 +10:00
|
|
|
const parts = req.headers.authorization.split(" ");
|
2020-02-19 15:55:06 +11:00
|
|
|
|
2025-09-02 21:43:00 +10:00
|
|
|
if (parts && parts[0] === "Bearer" && parts[1]) {
|
2020-02-19 15:55:06 +11:00
|
|
|
res.locals.token = parts[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
|
};
|
2025-09-02 21:43:00 +10:00
|
|
|
}
|