summaryrefslogtreecommitdiff
path: root/src/service/uiaa/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/uiaa/mod.rs')
-rw-r--r--src/service/uiaa/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/service/uiaa/mod.rs b/src/service/uiaa/mod.rs
index 147ce4d..ed39af9 100644
--- a/src/service/uiaa/mod.rs
+++ b/src/service/uiaa/mod.rs
@@ -96,6 +96,17 @@ impl Service {
// Password was correct! Let's add it to `completed`
uiaainfo.completed.push(AuthType::Password);
}
+ AuthData::RegistrationToken(t) => {
+ if Some(t.token.trim()) == services().globals.config.registration_token.as_deref() {
+ uiaainfo.completed.push(AuthType::RegistrationToken);
+ } else {
+ uiaainfo.auth_error = Some(ruma::api::client::error::StandardErrorBody {
+ kind: ErrorKind::Forbidden,
+ message: "Invalid registration token.".to_owned(),
+ });
+ return Ok((false, uiaainfo));
+ }
+ }
AuthData::Dummy(_) => {
uiaainfo.completed.push(AuthType::Dummy);
}