Model for the Login page.
More...
Model for the Login page.
◆ LoginModel()
BetterFinds.Pages.LoginModel.LoginModel |
( |
IConfiguration |
configuration | ) |
|
Initializes a new instance of the LoginModel class.
- Parameters
-
configuration | The IConfiguration instance. |
◆ OnGet()
IActionResult BetterFinds.Pages.LoginModel.OnGet |
( |
| ) |
|
|
inline |
The action that occurs when the user visits the login page.
Checks if the user is already logged in. If so, redirects to the index page. If the user got redirected from logout, displays a success logout message. If the user got redirected from register, enters the username they just created and displays a success register message.
- Returns
- A task that represents the action of loading the login page.
- Returns
◆ OnPostAsync()
async Task<IActionResult> BetterFinds.Pages.LoginModel.OnPostAsync |
( |
| ) |
|
|
inline |
The action that occurs when the user submits the login form.
Checks if the username and password are valid. If so, logs the user in and redirects to the index page. If not, displays an error message. Manually creates the cookie to store the ClientId in the session.
- Returns
- A task that represents the asynchronous operation of logging in.
◆ configuration
readonly IConfiguration BetterFinds.Pages.LoginModel.configuration |
|
private |
The IConfiguration instance.
◆ Password
string BetterFinds.Pages.LoginModel.Password = "" |
|
getset |
The password entered by the user.
◆ RememberMe
bool BetterFinds.Pages.LoginModel.RememberMe = false |
|
getset |
Whether the user wants to stay logged in.
◆ Username
string BetterFinds.Pages.LoginModel.Username = "" |
|
getset |
The username entered by the user.
The documentation for this class was generated from the following file:
- BetterFinds/Pages/Login.cshtml.cs