Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LoginResult.cs
1using System;
2
4{
8 public enum LoginResultType
9 {
13 PermanentlyBlocked,
14
18 TemporarilyBlocked,
19
23 InvalidCredentials,
24
28 NoPassword,
29
33 Success
34 }
35
39 public class LoginResult
40 {
41 private readonly User user;
42 private readonly DateTime? next;
43 private readonly LoginResultType type;
44
49 public LoginResult(DateTime Next)
50 {
51 this.user = null;
52 this.next = Next;
53 this.type = Next == DateTime.MaxValue ? LoginResultType.PermanentlyBlocked : LoginResultType.TemporarilyBlocked;
54 }
55
61 {
62 this.user = User;
63 this.next = null;
64 this.type = User is null ? LoginResultType.InvalidCredentials : LoginResultType.Success;
65 }
66
70 public LoginResult()
71 {
72 this.user = null;
73 this.next = null;
74 this.type = LoginResultType.NoPassword;
75 }
76
80 public User User => this.user;
81
85 public DateTime? Next => this.next;
86
90 public LoginResultType Type => this.type;
91 }
92}
Contains information about a login attempt.
Definition: LoginResult.cs:40
DateTime? Next
Time when a new login can be attempted.
Definition: LoginResult.cs:85
User User
User object corresponding to the successfully logged in user.
Definition: LoginResult.cs:80
LoginResultType Type
Type of login result.
Definition: LoginResult.cs:90
LoginResult(DateTime Next)
Remote endpoint has been blocked.
Definition: LoginResult.cs:49
LoginResult(User User)
Login attempt has been made.
Definition: LoginResult.cs:60
LoginResult()
Empty password provided
Definition: LoginResult.cs:70
Corresponds to a user in the system.
Definition: User.cs:21
LoginResultType
Result of login attempt
Definition: LoginResult.cs:9