Skip to content

Commit

Permalink
Remove experimental change password #183
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Apr 22, 2022
1 parent fa16d01 commit 9594686
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 170 deletions.
108 changes: 6 additions & 102 deletions app/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,117 +333,21 @@ <h4 data-loc>You can use these shortcuts inside the application only. Use englis
<!-- experimental -->
<div id="experimental" class="tabcontent part hidden">
<div class="mx-auto mt-5 rounded-2xl bg-gray-800 md:w-4/5 lg:w-2/3">
<h3 class="relative top-7" data-loc>Experimental features</h3>
<h4 class="pt-5" data-loc>These features are under development and can be unstable! Use it at your own risk!</h4>
<button class="buttoni mb-8" onclick="experimentalDocs()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" />
</svg>
<span data-loc>Features</span>
</button>
</div>
<!-- <hr />
<div>
<h3>Backup</h3>
<h4>You can create backup codes and backup files.</h4>
<div class="flex flex-row flex-wrap justify-center gap-3">
<button class="buttoni" onclick="createBackupFile()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M14 3v4a1 1 0 0 0 1 1h4"></path>
<path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3"></path>
</svg>
Create backup file
</button>
<button class="buttoni" onclick="loadBackupFileDialog()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M14 3v4a1 1 0 0 0 1 1h4"></path>
<path d="M5 13v-8a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5.5m-9.5 -2h7m-3 -3l3 3l-3 3"></path>
</svg>
Load backup file
</button>
</div>
</div> -->
<hr />
<div>
<h3>Change password</h3>
<h4>You can change your password with your old password.</h4>
<button class="buttoni" onclick="changePasswordDialog()">
<h3 class="relative top-7">Experimental features</h3>
<h4 class="pt-5">These features are under development and can be unstable, use them at your own risk! Check out current experiments on GitHub issues!</h4>
<h4>There are no experiments currently! Please check back later!</h4>
<button class="buttoni mb-8" onclick="githubIssues()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<rect x="5" y="11" width="14" height="10" rx="2"></rect>
<circle cx="12" cy="16" r="1"></circle>
<path d="M8 11v-5a4 4 0 0 1 8 0"></path>
<path d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5"></path>
</svg>
Change password
Github Issues
</button>
</div>
</div>
</div>
</div>
</div>
</div>

<!-- change password dialog -->
<dialog class="dialog dialog0">
<h2>Change password</h2>
<h4 class="passwordText">Please type in your old password and your new password!</h4>

<div class="mt-10 flex flex-col items-center justify-center">
<div class="flex flex-col">
<label class="mb-1">Old password</label>
<input class="input" type="password" id="password_input1" spellcheck="false" />
<svg onclick="showPassword(1)" tabindex="0" xmlns="http://www.w3.org/2000/svg" class="relative top-[-45px] left-[250px] h-6 w-6 cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="black" id="show_pass_1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
<svg onclick="showPassword(1)" tabindex="0" xmlns="http://www.w3.org/2000/svg" class="relative top-[-45px] left-[250px] hidden h-6 w-6 cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="black" id="show_pass_11">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
</svg>
</div>

<div class="flex flex-col">
<label class="mb-1 mt-3">New password</label>
<input class="input" type="password" id="password_input2" spellcheck="false" />
<svg onclick="showPassword(2)" tabindex="0" xmlns="http://www.w3.org/2000/svg" class="relative top-[-45px] left-[250px] h-6 w-6 cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="black" id="show_pass_2">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
<svg onclick="showPassword(2)" tabindex="0" xmlns="http://www.w3.org/2000/svg" class="relative top-[-45px] left-[250px] hidden h-6 w-6 cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="black" id="show_pass_21">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
</svg>
</div>

<div class="flex flex-col">
<label class="mb-1 mt-3">Confirm new password</label>
<input class="input" type="password" id="password_input3" spellcheck="false" />
<svg onclick="showPassword(3)" tabindex="0" xmlns="http://www.w3.org/2000/svg" class="relative top-[-45px] left-[250px] h-6 w-6 cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="black" id="show_pass_3">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
<svg onclick="showPassword(3)" tabindex="0" xmlns="http://www.w3.org/2000/svg" class="relative top-[-45px] left-[250px] hidden h-6 w-6 cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="black" id="show_pass_31">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />
</svg>
</div>
</div>

<div class="mt-10 flex items-center justify-center gap-3">
<button class="buttoni dialog0Close w-44">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Cancel
</button>

<button class="buttoni close-button w-44" onclick="changePassword()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Confirm
</button>
</div>
</dialog>
</body>
</html>
63 changes: 2 additions & 61 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,65 +881,6 @@ window.addEventListener("click", (event) => {
})

/* Experimental docs */
const experimentalDocs = () => {
shell.openExternal("https://docs.authme.levminer.com/#/settings?id=experimental-features")
}

/**
* Show password
*/
let password_shown = false

const showPassword = (id) => {
if (password_shown === false) {
document.querySelector(`#password_input${id}`).setAttribute("type", "text")

document.querySelector(`#show_pass_${id}`).style.display = "none"
document.querySelector(`#show_pass_${id}1`).style.display = "flex"

password_shown = true
} else {
document.querySelector(`#password_input${id}`).setAttribute("type", "password")

document.querySelector(`#show_pass_${id}`).style.display = "flex"
document.querySelector(`#show_pass_${id}1`).style.display = "none"

password_shown = false
}
}

/* Show/hide load backup file dialog */
const loadBackupFileDialog = () => {
const /** @type{LibDialogElement} */ dialog1 = document.querySelector(".dialog1")
const close_dialog = document.querySelector(".dialog1Close")

close_dialog.addEventListener("click", () => {
dialog1.close()
})

dialog1.showModal()
}

/* Show/hide change password dialog */
const changePasswordDialog = () => {
const /** @type{LibDialogElement} */ dialog0 = document.querySelector(".dialog0")
const close_dialog = document.querySelector(".dialog0Close")

close_dialog.addEventListener("click", () => {
dialog0.close()
})

if (settings.security.require_password == true) {
dialog0.showModal()
} else {
dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
title: "Authme",
buttons: [lang.button.close],
defaultId: 1,
cancelId: 1,
noLink: true,
type: "error",
message: "You are using Authme without a password! \n\n You can't change your generated password!",
})
}
const githubIssues = () => {
shell.openExternal("https://github.com/Levminer/authme/issues")
}
3 changes: 0 additions & 3 deletions languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ module.exports = {
"You can use these shortcuts everywhere, even outside the application. Use english characters only, during editing shortcuts don't work.",
"Shortcuts",
"You can use these shortcuts inside the application only. Use english characters only, during editing shortcuts don't work.",
"Experimental features",
"These features are under development and can be unstable! Use it at your own risk!",
"Features",
],

"settings_dialog": {
Expand Down
3 changes: 0 additions & 3 deletions languages/hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ module.exports = {
"Ezeket a gyorsgombokat bárhol hasznáhatod, még az alkalmazáson kívűl is. Csak angol karaktereket használj, szerkesztés közben a gyorsgombok nem működnek.",
"Gyorsgombok",
"Ezeket a gyorsgombokat csak az alkalmazáson belül használhatod. Csak angol karaktereket használj, szerkesztés közben a gyorsgombok nem működnek.",
"Kísérleti funkciók",
"Ezek a fukciók fejlesztés alatt állnak és instabilak lehetnek! Csak saját felelősségre!",
"Funkciók",
],

"settings_dialog": {
Expand Down
Loading

0 comments on commit 9594686

Please sign in to comment.