Skip to content

Commit fb16c08

Browse files
committed
fix(Moodle): auth failure notification isn't being resolved
1 parent 0e5faa0 commit fb16c08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

integrations/moodle/src/main/kotlin/me/snoty/integration/moodle/MoodleIntegration.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class MoodleIntegration(
3838
): NodeOutput {
3939
val moodleSettings = node.getConfig<MoodleSettings>()
4040

41+
val authFailureAttributes = NotificationAttributes(type = "moodle.authfailure", flowId = node.flowId, nodeId = node._id)
4142
val assignments = try {
4243
moodleAPI.getCalendarUpcoming(moodleSettings)
4344
} catch (e: MoodleException) {
@@ -49,13 +50,14 @@ class MoodleIntegration(
4950
userId = node.userId.toString(),
5051
title = "Moodle Authentication Error",
5152
description = message,
52-
attributes = NotificationAttributes(type = "moodle.authfailure", flowId = node.flowId, nodeId = node._id),
53+
attributes = authFailureAttributes,
5354
)
5455
return emptyList()
5556
}
5657
else -> throw e
5758
}
5859
}
60+
notificationService.resolve(node.userId.toString(), authFailureAttributes)
5961

6062
logger.atLevel(
6163
if (assignments.isEmpty()) Level.WARN

0 commit comments

Comments
 (0)