Skip to content

Commit 15c47d6

Browse files
committed
password change form
1 parent b250ee6 commit 15c47d6

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[*]
2-
end_of_line = crlf
2+
end_of_line = lf
33
insert_final_newline = true
44
indent_style = space
55
indent_size = 4

Views/Auth/Register.cshtml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<label for="password">Password</label>
1717
</div>
1818
<div class="input-field col s6">
19-
<input id="password_conf" type="password" placeholder="Repeat password" required>
20-
<label for="password_conf">Repeat Password</label>
19+
<input id="passwordConfirmation" type="password" placeholder="Repeat password" required>
20+
<label for="passwordConfirmation">Repeat Password</label>
2121
</div>
2222
</div>
2323
<button style="width:60%; margin-bottom:10px" class="waves-effect waves-light btn" type="submit">Submit</button>
@@ -26,7 +26,7 @@
2626
<script>
2727
function register() {
2828
29-
if (document.getElementById("password").value != document.getElementById("password_conf").value) {
29+
if (document.getElementById("password").value != document.getElementById("passwordConfirmation").value) {
3030
M.toast({ html: "Passwords do not match!", classes: "red" });
3131
return false;
3232
}

Views/Profile/Profile.cshtml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@{
2+
ViewData["Title"] = "Profile";
3+
}
4+
<h2>@ViewData["Title"]</h2>
5+
6+
<form class="col s12 compactForm" id="passwordChangeForm" action="/Profile/ChangePassword" method="post" onsubmit="return changePassword()">
7+
<div class="row">
8+
<div class="input-field col s6">
9+
<input placeholder="Current Password" name="currentPassword" id="currentPassword" type="password" required>
10+
<label for="password">Current Password</label>
11+
</div>
12+
<div class="input-field col s6">
13+
<input id="newPassword" type="password" placeholder="New password" required>
14+
<label for="newPassword">New Password</label>
15+
</div>
16+
<div class="input-field col s6">
17+
<input id="newPasswordConfirmation" type="password" placeholder="Repeat password" required>
18+
<label for="newPasswordConfirmation">Repeat New Password</label>
19+
</div>
20+
</div>
21+
<button style="width:60%; margin-bottom:10px" class="waves-effect waves-light btn" type="submit">Submit</button>
22+
</form>
23+
24+
<script>
25+
function changePassword() {
26+
if (document.getElementById("newPassword").value != document.getElementById("newPasswordConfirmation").value) {
27+
M.toast({ html: "Passwords do not match!", classes: "red" });
28+
return false;
29+
}
30+
}</script>

netcore-postgres-oauth-boiler.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<PackageReference Include="Google.Apis.Auth" Version="1.44.1" />
1515
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.2" />
1616
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
17+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
1718
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1819
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.2" />
1920
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />

0 commit comments

Comments
 (0)