Skip to content

Commit

Permalink
fix(request): update validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 19, 2024
1 parent 12b2bf6 commit fbfaa83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/request.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { dto } from './dto.js';
import { session } from './session.js';

export const HTTP_GET = 'GET';
export const HTTP_POST = 'POST';
Expand Down Expand Up @@ -104,7 +103,7 @@ export const request = (method, path) => {
* @returns {this}
*/
token(token) {
if (session.isAdmin()) {
if (token.split('.').length === 3) {
req.headers.append('Authorization', 'Bearer ' + token);
return this;
}
Expand Down

0 comments on commit fbfaa83

Please sign in to comment.