mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 18:00:44 +01:00
Update authenticate.js
This commit is contained in:
parent
81a6a36fba
commit
6ed9bafc73
@ -26,9 +26,10 @@ exports.authenticateUserWithCookie = (req, res, next) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.authenticateUser = (req, res, next) => {
|
exports.authenticateUser = (req, res, next) => {
|
||||||
password = atob(req.body.password);
|
|
||||||
if(+common.rtl_sso) {
|
if(+common.rtl_sso) {
|
||||||
if (common.cookie === password) {
|
const access_key = req.cookies['access-key'];
|
||||||
|
res.clearCookie("access-key");
|
||||||
|
if (common.cookie === access_key) {
|
||||||
const token = jwt.sign(
|
const token = jwt.sign(
|
||||||
{ user: 'Custom_User', lndConfigPath: common.lnd_config_path, macaroonPath: common.macaroon_path },
|
{ user: 'Custom_User', lndConfigPath: common.lnd_config_path, macaroonPath: common.macaroon_path },
|
||||||
'default_secret_key'
|
'default_secret_key'
|
||||||
@ -41,6 +42,7 @@ exports.authenticateUser = (req, res, next) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
password = atob(req.body.password);
|
||||||
if(upperCase(common.node_auth_type) === 'CUSTOM') {
|
if(upperCase(common.node_auth_type) === 'CUSTOM') {
|
||||||
if (common.rtl_pass === password) {
|
if (common.rtl_pass === password) {
|
||||||
var rpcUser = 'Custom_User';
|
var rpcUser = 'Custom_User';
|
||||||
|
Loading…
Reference in New Issue
Block a user