mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
chore: Update client to use bearer token
This commit is contained in:
parent
641b88cd25
commit
8a7017eb1c
2 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ export default async (req: Request, res: Response) => {
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
if (auth) {
|
if (auth) {
|
||||||
client.setHeaders({ auth });
|
client.setHeaders({ Authorization: `Bearer ${auth}` });
|
||||||
}
|
}
|
||||||
const { path, url, query } = req;
|
const { path, url, query } = req;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ export class UserService {
|
||||||
const { jwt } = cookie.parse(document.cookie);
|
const { jwt } = cookie.parse(document.cookie);
|
||||||
|
|
||||||
if (jwt) {
|
if (jwt) {
|
||||||
HttpService.client.setHeaders({ auth: jwt });
|
HttpService.client.setHeaders({ Authorization: `Bearer ${jwt}` });
|
||||||
this.jwtInfo = { jwt, claims: jwt_decode(jwt) };
|
this.jwtInfo = { jwt, claims: jwt_decode(jwt) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue