Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 3 additions & 28 deletions _layouts/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ <h2 class="text-xl font-semibold mb-6">Personal Information</h2>

<!-- Password Change -->
<div>
<label for="password" class="block text-sm font-medium text-gray-300 mb-1">New
Password</label>
<input type="password" id="password" name="password"
class="w-full px-4 py-2 rounded-lg border border-gray-600 bg-neutral-700 focus:outline-none focus:ring-2 focus:ring-indigo-500"
placeholder="Enter new password" onchange="checkForChanges()" autocomplete="new-password">
<label class="block text-sm font-medium text-gray-300 mb-1">Password</label>
<a href="{{ site.baseurl }}/support?topic=reset" class="text-sm text-indigo-400 hover:text-indigo-300 inline-block">Forgot your password?</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -1317,7 +1314,6 @@ <h4 class="text-red-400 font-semibold mb-1">Selection Failed</h4>
const uidInput = document.getElementById("uidChangeInput");
const emailInput = document.getElementById("emailChangeInput");
const sidInput = document.getElementById("sidChangeInput");
const passwordInput = document.getElementById("password");
const kasmInput = document.getElementById("kasmChangeInput");
const schoolInput = document.getElementById("schoolChangeInput");

Expand All @@ -1326,7 +1322,6 @@ <h4 class="text-red-400 font-semibold mb-1">Selection Failed</h4>
const uid = uidInput.value.trim();
const email = emailInput.value.trim();
const sid = sidInput.value.trim();
const password = passwordInput.value.trim();
const kasmServerNeeded = kasmInput ? kasmInput.checked : undefined;
const school = schoolInput.value;

Expand Down Expand Up @@ -1422,26 +1417,6 @@ <h4 class="text-red-400 font-semibold mb-1">Selection Failed</h4>
}
}

// save password (both backends, logs out)
if (password) {
try {
await Promise.all([
putUpdate({
URL: pythonURI + "/api/user",
body: { password },
message: 'password-message'
}),
postUpdate({
URL: javaURI + "/api/person/update",
body: { password }
})
]);
needsLogout = true;
} catch (e) {
console.error("error saving password:", e.message);
}
}

// save kasm server status (both backends)
if (
typeof kasmServerNeeded !== "undefined" &&
Expand Down Expand Up @@ -1511,7 +1486,7 @@ <h4 class="text-red-400 font-semibold mb-1">Selection Failed</h4>

// handle reload or logout if needed
if (needsLogout) {
alert("you updated your github id or password, so you will be logged out. remember your new credentials!");
alert("you updated your github id, so you will be logged out. remember your new credentials!");
window.location.href = '{{site.baseurl}}';
} else if (needsReload) {
window.location.reload();
Expand Down
3 changes: 3 additions & 0 deletions navigation/authentication/login.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ show_reading_time: false
<button type="submit" class="large primary submit-button">Login</button>
</p>
<p id="message" style="color: red;"></p>
<p style="text-align: center;">
<a href="{{site.baseurl}}/support?topic=reset">Forgot your password?</a>
</p>
</form>
</div>
<div class="signup-card">
Expand Down