Skip to content

Commit

Permalink
authme 2.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer authored Dec 14, 2021
1 parent 899f7ee commit c33be82
Show file tree
Hide file tree
Showing 9 changed files with 465 additions and 286 deletions.
59 changes: 59 additions & 0 deletions app/application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,65 @@
</div>
</div>

<!-- deprecation notice -->
<div class="w-full text-white bg-popup-magenta font-bold deprecationNotice">
<div class="container flex flex-row items-center justify-between px-6 py-4 mx-auto mb-5">
<div class="flex">
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-2.5" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>

<p class="mx-3 flex flex-row relative top-3">
Authme 3 is releasing on December 28., this means there is no update coming to Authme 2. Please migrate when Authme 3 comes out!
</p>
</div>
<a onclick="this.parentElement.style.display='none'" class="p-1 relative top-3 transition-colors duration-200 transform rounded-md hover:text-gray-800 cursor-pointer">
<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="M6 18L18 6M6 6l12 12" />
</svg>
</a>
</div>
</div>

<!-- deprecation -->
<div class="w-full text-white bg-popup-magenta font-bold deprecation hidden">
<div class="container flex flex-row items-center justify-between px-6 py-4 mx-auto">
<div class="flex">
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-7" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>

<p class="mx-3 flex flex-row flex-wrap relative top-3 mb-5">
Authme 2 is deprecated. Please upgrade to Authme 3!<br />
This is a major release so there are some minor breaking changes, please follow the migration guide.<br />
But there are some notable changes to: Auto update, import from camera, macOS support and more!
<div class="pt-5 pl-5 flex flex-wrap gap-1">
<button type="button" onclick="migrationGuide()" class="mr-2 ml-3 py-1 px-3 relative -top-1.5 bg-white hover:bg-transparent text-black border-2 border-white hover:text-white cursor-pointer transition ease-in duration-200 text-center text-base font-bold rounded-full">
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-1" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
Migration guide
</button>

<button type="button" onclick="downloadUpdate()" class="py-1 mr-2 ml-2 px-3 relative -top-1.5 bg-white hover:bg-transparent text-black border-2 border-white hover:text-white cursor-pointer transition ease-in duration-200 text-center text-base font-bold rounded-full">
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-1" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
</svg>
Download
</button>

<button type="button" onclick="releaseNotes()" class="mr-2 ml-3 py-1 px-3 relative -top-1.5 bg-white hover:bg-transparent text-black border-2 border-white hover:text-white cursor-pointer transition ease-in duration-200 text-center text-base font-bold rounded-full">
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-1" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" />
</svg>
Release notes
</button>
</div>
</p>
</div>
</div>
</div>

<!-- content -->
<div class="bg-gray-700 w-3/5 mx-auto mt-20 mb-60 rounded-2xl relative text-center content">
<h1 class="h1 mb-5">Authme</h1>
Expand Down
17 changes: 15 additions & 2 deletions app/application/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,12 +871,17 @@ const quickCopy = (key) => {

// ? release notes
const releaseNotes = () => {
ipc.send("release_notes")
shell.openExternal("https://github.com/Levminer/authme/releases/latest")
}

// ? download update
const downloadUpdate = () => {
ipc.send("download_update")
shell.openExternal("https://authme.levminer.com/#downloads")
}

// ? migration guide
const migrationGuide = () => {
shell.openExternal("https://docs.authme.levminer.com/#/migration")
}

// ? rate
Expand Down Expand Up @@ -934,3 +939,11 @@ window.addEventListener("click", (event) => {
dropdown_state = false
}
})

const date = new Date()
const release = new Date("2021-12-30")

if (date > release) {
document.querySelector(".deprecation").style.display = "block"
document.querySelector(".deprecationNotice").style.display = "none"
}
11 changes: 10 additions & 1 deletion app/export/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ <h3>If you saved your config you can export the secrets and the QR code(s).</h3>
<div class="mx-auto rounded-2xl bg-gray-800 w-2/3 mt-20 mb-20">
<h2 class="pt-5">Save exported code(s)</h2>
<h3>Save your exported data as a file to use it elsewhere.</h3>
<div class="flex flex-row justify-center gap-3 flex-wrap">
<div class="flex flex-col justify-center gap-3 pb-3">
<div>
<button class="buttoni" id="but1" onclick="newSaveFile()">
<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="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" />
</svg>
Save as .authme
</button>
<h5 class="text-3 m-3">The new way to import for Authme 3.</h5>
</div>
<div>
<button class="buttoni" id="but1" onclick="saveFile()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand Down
39 changes: 39 additions & 0 deletions app/export/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,42 @@ const newExp = () => {
}
})
}

// ? new save file
const newSaveFile = () => {
dialog
.showSaveDialog({
title: "Save as Authme file",
filters: [{ name: "Authme file", extensions: ["authme"] }],
defaultPath: "~/export.authme",
})
.then((result) => {
canceled = result.canceled
output = result.filePath

/**
* .authme export file
* @type {LibAuthmeFile}
*/
const save_file = {
role: "export",
encrypted: false,
codes: Buffer.from(file).toString("base64"),
date: time.timestamp(),
version: 3,
}

if (canceled === false) {
fs.writeFile(output, JSON.stringify(save_file, null, "\t"), (err) => {
if (err) {
return logger.error(`Error creating file - ${err}`)
} else {
return logger.log("Text file created")
}
})
}
})
.catch((err) => {
logger.error(`Failed to save - ${err}`)
})
}
4 changes: 2 additions & 2 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ const reset = () => {
localStorage.removeItem("dev_storage")
}

// restart
restart()
// exit app
app.exit()
}
})
}
Expand Down
2 changes: 0 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,6 @@ const createWindow = () => {
}

if (update_seen == false) {
api()

update_seen = true
}
})
Expand Down
Loading

0 comments on commit c33be82

Please sign in to comment.