Skip to content

Commit

Permalink
fix: retry obtaining token without SSO in any case
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Jun 15, 2024
1 parent 6c56aa6 commit 33e82b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/shared/moodle-ws-api/token-for-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export async function obtainMobileToken(options: { useSSO?: boolean } = { useSSO
// Extract token from html page
const encodedToken = resp.data.match(/"moodlemobile:\/\/token=(.*)"/)?.[1]
if (!encodedToken) {
console.error('Couldn\'t get mobile_app token')
return {}
throw new Error('No token present on page')
}

// Split token into siteId, token, privateToken
Expand Down

0 comments on commit 33e82b5

Please # to comment.