src/api.js
// This is only allowed if the token is still valid and has the correct access rights.
This is only allowed if the token is still valid and has the correct access rights.
This is only allowed if the token is still valid and has the correct access rights .
async function validateToken(token) {
  try {
    await getItem({ token, type: 'album', index: 0 });
    return true;
  } catch(e) {
    console.error(e);
    return false;
  }
}
async function validateToken ( token ) { try { await getItem ( { token , type : 'album' , index : 0 } ) ; return true ; } catch ( e ) { console . error ( e ) ; return false ; } }
This is only allowed if the token is still valid and has the correct access rights.
This is only allowed if the token is still valid and has the correct access rights .
// We use `getItem` instead of `getItemInternal` to ensure that all required // data fields are accessible.