add basic account creation

This commit is contained in:
sam 2024-05-20 20:37:22 +02:00
parent 7a0247b551
commit 7959b64fe6
4 changed files with 44 additions and 5 deletions

View file

@ -24,4 +24,17 @@ public class Token : BaseModel
return (token, hash);
}
public static (string, Token) Create(Account? account, Application application, string[] scopes, Instant expires)
{
var (token, hash) = Generate();
return (token, new()
{
Hash = hash,
Scopes = scopes,
Expires = expires,
Account = account,
Application = application,
});
}
}