Making the passwords more safe

This commit is contained in:
Kasper Rynning-Tønnesen
2015-05-14 16:15:35 +02:00
parent a84fe0577d
commit 545571f8c8
3 changed files with 10 additions and 4 deletions

View File

@@ -14,7 +14,10 @@ socket.on("toast", function(msg)
break;
case "wrongpass":
msg=rnd(["That's not the right password!", "Wrong! Better luck next time...", "You seem to have mistyped the password", "Incorrect. Have you tried meditating?","Nope, wrong password!", "Wrong password. The authorities have been notified."])
break;
if(localStorage[chan.toLowerCase()]){
localStorage.removeItem(chan.toLowerCase());
}
break;
case "shuffled":
msg=rnd(["I vigorously stirred your playlist!", "I hope you like your list stirred, not shaken.", "I shuffled your playlist with the cosmic background radiation as a seed. Enjoy.", "100% randomized, for your listening pleasure!", "I hope you enjoy your fresh playlist!"])
break;
@@ -75,12 +78,13 @@ $('input[class=conf]').change(function()
function pass_save()
{
socket.emit('password', [document.getElementById("password").value, chan.toLowerCase(), guid]);
socket.emit('password', [CryptoJS.SHA256(document.getElementById("password").value).toString(), chan.toLowerCase(), guid]);
}
function log_out(){
if(localStorage[chan.toLowerCase()]){
localStorage.removeItem(chan.toLowerCase())
localStorage.removeItem(chan.toLowerCase());
w_p = true;
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
for (var i = 0; i < names.length; i++) {

View File

@@ -104,7 +104,8 @@ $(document).ready(function()
if(localStorage[chan.toLowerCase()])
{
socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase(), guid]);
localStorage.removeItem(chan.toLowerCase());
//socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase(), guid]);
}
if($("#chan").html().toLowerCase() == "jazz")