ToolController: impl signup
This commit is contained in:
@@ -17,11 +17,19 @@ final class Session: Model, @unchecked Sendable {
|
||||
|
||||
init() { }
|
||||
|
||||
init(account: Account, expires: Date, type: SessionType) throws {
|
||||
self.id = UUID().uuidString
|
||||
self.$account.id = try account.requireID()
|
||||
convenience init(account: Account, expires: Date, type: SessionType) throws {
|
||||
self.init(accountId: try account.requireID(), expires: expires, type: type)
|
||||
}
|
||||
|
||||
init(accountId: Int, expires: Date, type: SessionType) {
|
||||
self.$account.id = accountId
|
||||
self.expires = expires
|
||||
self.type = type
|
||||
if (type != .VIEWER) {
|
||||
self.id = UUID().uuidString
|
||||
} else {
|
||||
self.id = String(Int.random())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user