Skip to content

Commit 33e82b5

Browse files
fix: retry obtaining token without SSO in any case
1 parent 6c56aa6 commit 33e82b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/shared/moodle-ws-api/token-for-session.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ export async function obtainMobileToken(options: { useSSO?: boolean } = { useSSO
3131
// Extract token from html page
3232
const encodedToken = resp.data.match(/"moodlemobile:\/\/token=(.*)"/)?.[1]
3333
if (!encodedToken) {
34-
console.error('Couldn\'t get mobile_app token')
35-
return {}
34+
throw new Error('No token present on page')
3635
}
3736

3837
// Split token into siteId, token, privateToken

0 commit comments

Comments
 (0)