-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3d067a
commit d8d0cce
Showing
17 changed files
with
254 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,113 +8,75 @@ | |
@inject SignInManager<ApplicationUser> SignInManager | ||
|
||
<div class="mt-8"> | ||
@if (!SignInManager.IsSignedIn(User)) | ||
{ | ||
<div class="max-w-xl mx-auto"> | ||
<h1 class="mb-4 text-2xl font-semibold text-gray-900 dark:text-gray-100"> | ||
Sign In | ||
</h1> | ||
<div class="sm:shadow overflow-hidden sm:rounded-md"> | ||
<form method="post"> | ||
<div class="px-4 bg-white dark:bg-black sm:p-6"> | ||
<div asp-validation-summary="All" class="text-danger font-semibold text-center"></div> | ||
<div class="flex flex-col gap-y-4"> | ||
<div> | ||
<input type="hidden" name="redirect" value="@(Html.GetQueryString("ReturnUrl") ?? ViewData["ReturnUrl"])" /> | ||
</div> | ||
<div> | ||
@if (!SignInManager.IsSignedIn(User)) | ||
{ | ||
<div class="max-w-xl mx-auto"> | ||
<h1 class="mb-4 text-2xl font-semibold text-gray-900 dark:text-gray-100"> | ||
Sign In | ||
</h1> | ||
<div class="sm:shadow overflow-hidden sm:rounded-md"> | ||
<form method="post"> | ||
<div class="px-4 bg-white dark:bg-black sm:p-6"> | ||
<div asp-validation-summary="All" class="text-danger font-semibold text-center"></div> | ||
<div class="flex flex-col gap-y-4"> | ||
<div> | ||
<input type="hidden" name="redirect" value="@(Html.GetQueryString("ReturnUrl") ?? ViewData["ReturnUrl"])"/> | ||
</div> | ||
<div> | ||
<label for="UserName" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email</label> | ||
<div class="mt-1 relative rounded-md shadow-sm"> | ||
<input type="text" class="@Css.InputText" id="Username" name="Username" placeholder="Username" spellcheck="false" value="@Html.GetFormData("Username")"> | ||
<div> | ||
<label for="Email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email</label> | ||
<div class="mt-1 relative rounded-md shadow-sm"> | ||
<input type="text" class="@Css.InputText" id="Email" name="Email" placeholder="Email" spellcheck="false" value="@Html.GetFormData("Email")"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
</div> | ||
<div> | ||
<label for="Password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Password</label> | ||
<div class="mt-1 relative rounded-md shadow-sm"> | ||
<input class="@Css.InputText" id="Password" name="Password" type="Password" placeholder="Password" value=""> | ||
<div> | ||
<label for="Password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Password</label> | ||
<div class="mt-1 relative rounded-md shadow-sm"> | ||
<input class="@Css.InputText" id="Password" name="Password" type="Password" placeholder="Password" value=""> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="flex items-center justify-between"> | ||
<div class="flex items-center"> | ||
<input type="checkbox" id="chkRememberMe" name="rememberMe" value="true" checked="checked" | ||
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"> | ||
<label for="chkRememberMe" class="ml-2 block text-sm text-gray-900">Remember Me</label> | ||
</div> | ||
<div class="text-sm"> | ||
<a asp-controller="Account" asp-action="ForgotPassword" class="font-medium text-indigo-600 hover:text-indigo-500">Forgot your password?</a> | ||
|
||
<div class="flex items-center justify-between"> | ||
<div class="flex items-center"> | ||
<input type="checkbox" id="chkRememberMe" name="rememberMe" value="true" checked="checked" | ||
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"> | ||
<label for="chkRememberMe" class="ml-2 block text-sm text-gray-900">Remember Me</label> | ||
</div> | ||
<div class="text-sm"> | ||
|
||
|
||
</div> | ||
</div> | ||
<button type="submit" class="@Css.PrimaryButton w-1/2 ml-2">Sign In</button> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
@* <div class="px-4 py-3 text-right sm:px-6"> *@ | ||
@* <div class="flex justify-end"> *@ | ||
@* <a class="@Css.SecondaryButton w-1/2" asp-area="" asp-controller="Account" asp-action="Register" asp-route-ReturnUrl="@ViewData["ReturnUrl"]">Register New User</a> *@ | ||
@* <button type="submit" class="@Css.PrimaryButton w-1/2 ml-2">Sign In</button> *@ | ||
@* </div> *@ | ||
@* </div> *@ | ||
</form> | ||
|
||
<div class="m-6"> | ||
<div class="relative"> | ||
<div class="absolute inset-0 flex items-center"> | ||
<div class="w-full border-t border-gray-300 dark:border-gray-700"></div> | ||
</div> | ||
<div class="relative flex justify-center text-sm"> | ||
<span class="bg-white dark:bg-black px-2 text-gray-500">Or continue with</span> | ||
<div class="px-4 py-3 text-right sm:px-6"> | ||
<div class="flex justify-end"> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
@{ | ||
@* var loginProviders = (await SignInManager.GetExternalAuthenticationSchemesAsync()).ToList(); *@ | ||
@* if (loginProviders.Count == 0) *@ | ||
@* { *@ | ||
@* <div> *@ | ||
@* <p> *@ | ||
@* There are no external authentication services configured. See <a class="@Css.Link" href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a> *@ | ||
@* for details on setting up this ASP.NET application to support logging in via external services. *@ | ||
@* </p> *@ | ||
@* </div> *@ | ||
@* } *@ | ||
@* else *@ | ||
@* { *@ | ||
@* <form asp-action="ExternalLogin" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" *@ | ||
@* class="mt-6 grid grid-cols-4 gap-3"> *@ | ||
@* @foreach (var provider in loginProviders) *@ | ||
@* { *@ | ||
@* <div> *@ | ||
@* <button type="submit" class="inline-flex w-full justify-center rounded-md border border-gray-300 dark:border-gray-700 bg-white dark:bg-black py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50" *@ | ||
@* name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account"> *@ | ||
@* <span class="sr-only">Sign in with @provider.Name</span> *@ | ||
@* <i class="text-gray-700 dark:text-gray-300 text-lg fab [email protected]()"></i> *@ | ||
@* </button> *@ | ||
@* </div> *@ | ||
@* } *@ | ||
@* </form> *@ | ||
@* } *@ | ||
} | ||
</div> | ||
</div> | ||
|
||
</form> | ||
|
||
|
||
|
||
</div> | ||
|
||
<div class="mt-8"> | ||
|
||
<div class="mt-8"> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
} | ||
else | ||
{ | ||
<div class="mx-auto prose prose-xl"> | ||
<table id="session-info"> | ||
<caption class="@Css.H1 mb-4">Authenticated User Session</caption> | ||
<tbody> | ||
} | ||
else | ||
{ | ||
<div class="mx-auto prose prose-xl"> | ||
<table id="session-info"> | ||
<caption class="@Css.H1 mb-4">Authenticated User Session</caption> | ||
<tbody> | ||
<tr> | ||
<th>Id</th> | ||
<td>@User.GetUserId()</td> | ||
|
@@ -137,11 +99,11 @@ else | |
<tr> | ||
<th>ProfileUrl</th> | ||
<td> | ||
<img class="w-20 h-20" src="@User.GetPicture()" /> | ||
<img class="w-20 h-20" src="@User.GetPicture()"/> | ||
</td> | ||
</tr> | ||
</tbody> | ||
<tfoot> | ||
</tbody> | ||
<tfoot> | ||
<tr> | ||
<td colspan="2"> | ||
<form asp-area="" asp-controller="Account" asp-action="Logout" method="post"> | ||
|
@@ -154,20 +116,8 @@ else | |
<p class="my-2">View Public and Secure Pages and APIs on <a class="@Css.Link" href="/">Home page</a>.</p> | ||
</td> | ||
</tr> | ||
</tfoot> | ||
</table> | ||
</div> | ||
} | ||
</div> | ||
|
||
@section Scripts { | ||
<script type="module"> | ||
import { $1, bindHandlers } from "@@servicestack/client" | ||
bindHandlers({ | ||
switchUser(u) { | ||
$1("#Email").value = u | ||
$1("#Password").value = 'p@55wOrd' | ||
}, | ||
}) | ||
</script> | ||
} | ||
</tfoot> | ||
</table> | ||
</div> | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.