Limited use registration token support

Co-authored-by: Ginger <ginger@gingershaped.computer>
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
dasha_uwuandGinger authored and Jason Volk committed 2026-01-26 20:24:15 +00:00
1 parent 0dbe79df8e
commit 56f3f5ea15
12 files changed
+494 -43

No files matched your search

+8 -2
View File
@@ -143,8 +143,14 @@ pub async fn try_auth(
uiaainfo.completed.push(AuthType::Password);
},
| AuthData::RegistrationToken(t) => {
let tokens = self.services.globals.get_registration_tokens();
if tokens.contains(t.token.trim()) {
let token = t.token.trim();
if self
.services
.registration_tokens
.try_consume(token)
.await
.is_ok()
{
uiaainfo
.completed
.push(AuthType::RegistrationToken);