Skip to content

Commit

Permalink
fix(session): null token
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 19, 2024
1 parent 0c0bfad commit c055c11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const session = (() => {
let ses = null;

/**
* @returns {string}
* @returns {string|null}
*/
const getToken = () => ses.get('token');

Expand Down Expand Up @@ -48,7 +48,7 @@ export const session = (() => {
/**
* @returns {boolean}
*/
const isAdmin = () => getToken().split('.').length === 3;
const isAdmin = () => String(getToken() ?? '.').split('.').length === 3;

/**
* @returns {Promise<ReturnType<typeof dto.baseResponse<object>>}
Expand Down

0 comments on commit c055c11

Please sign in to comment.