Skip to content

Commit

Permalink
Updated subsonic auth code
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince527GitHub committed Jun 15, 2024
1 parent b0b9bac commit ca46cbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions router/subsonic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ const proxy = require("../../packages/proxy");
const path = require("path");

function checkPassword(string, salt, password) {
if (string.startsWith("enc:")) {
if (string === password) return true;
else if (string.startsWith("enc:")) {
try {
const encodedData = string.substring(4);
const decodedString = Buffer.from(encodedData, 'hex').toString('utf-8');
return decodedString;
return decodedString === password;
} catch (error) {
return false;
}
Expand Down

0 comments on commit ca46cbc

Please sign in to comment.