Skip to content

Commit e29962c

Browse files
committed
fix: check the user email before synchronizing moodle calendar
1 parent db8bf71 commit e29962c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/features/moodle-calendar-url/background.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export async function syncMoodleCalendarUrl() {
2222
return false
2323
}
2424

25+
const siteInfo = await moodle.core.webservice.getSiteInfo({})
26+
if (user.email !== siteInfo.username) {
27+
console.log('Moodle account does not match InNoHassle account')
28+
return false
29+
}
30+
2531
try {
2632
const { token } = await moodle.core.calendar.getCalendarExportToken({})
2733
if (!token) {

0 commit comments

Comments
 (0)