feat: add user management, refs NOISSUE
This commit is contained in:
36
song_of_the_day/Pages/Shared/_LoginView.cshtml
Normal file
36
song_of_the_day/Pages/Shared/_LoginView.cshtml
Normal file
@@ -0,0 +1,36 @@
|
||||
@using Microsoft.AspNetCore.Authentication
|
||||
|
||||
<div class="loginform">
|
||||
@if (!this.User.Identity.IsAuthenticated)
|
||||
{
|
||||
<form method="post" action="Auth/Login">
|
||||
<div>
|
||||
<label for="username">Username:</label>
|
||||
</div>
|
||||
<div>
|
||||
<input name="username" type="text" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="password">Password:</label>
|
||||
</div>
|
||||
<div>
|
||||
<input name="password" type="password" />
|
||||
</div>
|
||||
<div>
|
||||
<input name="submit" type="submit" value="Login" />
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
<form method="post" action="Auth/Logout">
|
||||
<div>
|
||||
Welcome, @User.Identity.Name!
|
||||
</div>
|
||||
<div>
|
||||
<input name="submit" type="submit" value="Logout" />
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user