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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user