Removed unused files/code/imports/comments.

This commit is contained in:
chesspro13 2024-09-07 14:25:48 -07:00
parent 13937a2568
commit 9dd185e37e
No known key found for this signature in database
GPG Key ID: 5FEAE94D298066E5
6 changed files with 0 additions and 48 deletions

View File

@ -1,4 +1,3 @@
import options from '../../services/options.js';
import {generateSecret} from 'time2fa';
function generateTOTPSecret() {
@ -17,26 +16,10 @@ function getTotpEnabled() {
}
function getTOTPStatus() {
// const totpEnabled = options.getOptionBool('totpEnabled');
const totpEnabled = getTotpEnabled();
return {success: true, message: totpEnabled, enabled: getTotpEnabled()};
}
function enableTOTP() {
if (!getTotpEnabled()) {
return {success: 'false'};
}
options.setOption('totpEnabled', true);
options.setOption('oAuthEnabled', false);
return {success: 'true'};
}
function disableTOTP() {
options.setOption('totpEnabled', false);
return {success: true};
}
function getSecret() {
return process.env.TOTP_SECRET;
}
@ -44,7 +27,5 @@ function getSecret() {
export default {
generateSecret: generateTOTPSecret,
getTOTPStatus,
enableTOTP,
disableTOTP,
getSecret
};

View File

@ -124,8 +124,6 @@ function register(app: express.Application) {
apiRoute(GET, '/api/totp/generate', totp.generateSecret);
apiRoute(GET, '/api/totp/status', totp.getTOTPStatus);
apiRoute(PST, '/api/totp/enable', totp.enableTOTP);
apiRoute(PST, '/api/totp/disable', totp.disableTOTP);
apiRoute(GET, '/api/totp/get', totp.getSecret);
apiRoute(GET, '/api/oauth/status', openID.getOAuthStatus);

View File

@ -10,7 +10,6 @@ import passwordService from "./encryption/password.js";
import type { NextFunction, Request, Response } from 'express';
import { AppRequest } from '../routes/route-interface.js';
import openID from './open_id.js';
import sql from './sql.js';
import open_id_encryption from './encryption/open_id_encryption.js';
const noAuthentication = config.General && config.General.noAuthentication === true;

View File

@ -2,7 +2,6 @@
import optionService from "../options.js";
import crypto from "crypto";
import utils from "../utils.js";
import sql from "../sql.js";
function getVerificationHash(password: crypto.BinaryLike) {
@ -56,11 +55,6 @@ function createSubjectIdentifierDerivedKey(
subjectIdentifer: string | crypto.BinaryLike,
salt: string | crypto.BinaryLike
) {
// const salt = optionService.getOption("subjectIdentifierDerivedKeySalt");
// const salt = sql.getValue("SELECT salt FROM user_data");
// if (salt === undefined || salt === null) return undefined;
return getScryptHash(subjectIdentifer, salt);
}

View File

@ -1,19 +0,0 @@
import options from '../services/options.js';
function loadEnvironmentVariables(){
if (process.env.TOTP_ENABLED === undefined) {
options.setOption("totpEnabled", false);
return false;
}
if (process.env.TOTP_ENABLED.toLocaleLowerCase() !== 'true') {
options.setOption("totpEnabled", false);
return false;
}
options.setOption("totpEnabled", true);
}
export default {
loadEnvironmentVariables
}

View File

@ -115,7 +115,6 @@ function generateOAuthConfig() {
};
const logoutParams = {
// end_session_endpoint: "/end-session/",
};
const authConfig = {