Compare commits

..

No commits in common. "6fef87b0f1ec1139b07b803bce5081efdef48396" and "ece9569d666b731e7c96cb11f9e5cc520a1c04c7" have entirely different histories.

10 changed files with 12 additions and 43 deletions

View File

@ -64,12 +64,6 @@ async function login() {
}
}
function mounted() {
if (!this.$store.state.auth.enabled) {
this.$router.replace({ name: 'not-found' });
}
}
export default {
data() {
return {
@ -79,7 +73,6 @@ export default {
error: null,
};
},
mounted,
methods: {
login,
},

View File

@ -73,12 +73,6 @@ async function signup() {
}
}
function mounted() {
if (!this.$store.state.auth.enabled) {
this.$router.replace({ name: 'not-found' });
}
}
export default {
data() {
return {
@ -89,7 +83,6 @@ export default {
error: null,
};
},
mounted,
methods: {
signup,
},

View File

@ -2,13 +2,13 @@
<div class="menu">
<ul class="menu-items noselect">
<router-link
v-if="auth && me"
v-if="me"
:to="{ name: 'user', params: { username: me.username } }"
class="menu-username"
>{{ me.username }}</router-link>
<router-link
v-else-if="auth"
v-else
:to="{ name: 'login', query: { ref: $route.path } }"
class="menu-item"
@click.stop
@ -17,7 +17,7 @@
</router-link>
<li
v-if="auth && me"
v-if="me"
class="menu-item"
@click.stop="$store.dispatch('logout')"
>
@ -89,10 +89,6 @@ function theme(state) {
return state.ui.theme;
}
function auth(state) {
return state.auth.enabled;
}
function me(state) {
return state.auth.user;
}
@ -108,7 +104,6 @@ function setSfw(enabled) {
export default {
computed: {
...mapState({
auth,
sfw,
theme,
me,

View File

@ -1,4 +1,3 @@
export default {
enabled: window.env.auth,
user: null,
};

View File

@ -33,9 +33,6 @@ module.exports = {
accessKey: 'ABCDEFGHIJ1234567890',
secretKey: 'abcdefghijklmnopqrstuvwxyz1234567890ABCD',
},
auth: {
enabled: true,
},
exclude: {
channels: [
// 21sextreme, no longer updated

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "traxxx",
"version": "1.185.0",
"version": "1.184.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.185.0",
"version": "1.184.2",
"license": "ISC",
"dependencies": {
"@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.185.0",
"version": "1.184.2",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -1,6 +1,5 @@
'use strict';
const config = require('config');
const util = require('util');
const crypto = require('crypto');
@ -22,10 +21,6 @@ async function verifyPassword(password, storedPassword) {
}
async function login(credentials) {
if (!config.auth.enabled) {
throw new HttpError('Authentication is disabled', 405);
}
const user = await fetchUser(credentials.username, true);
if (!user) {
@ -38,10 +33,6 @@ async function login(credentials) {
}
async function signup(credentials) {
if (!config.auth.enabled) {
throw new HttpError('Authentication is disabled', 405);
}
if (!credentials.username) {
throw new HttpError('Username required', 400);
}

View File

@ -80,7 +80,7 @@ function getLimiter(options = {}, url) {
return limiters[interval][concurrency];
}
async function request(method = 'get', url, body, requestOptions = {}, limiter, timeout) {
async function request(method = 'get', url, body, requestOptions = {}, limiter) {
const http = requestOptions.session || bhttp;
const options = {
@ -107,7 +107,7 @@ async function request(method = 'get', url, body, requestOptions = {}, limiter,
? http[method](url, body, options)
: http[method](url, options));
timeout.cancel();
const resIsOk = res.statusCode >= 200 && res.statusCode <= 299;
if (options.destination) {
// res.on('progress', (bytes, totalBytes) => logger.silly(`Downloaded ${Math.round((bytes / totalBytes) * 100)}% of ${url}`));
@ -126,7 +126,7 @@ async function request(method = 'get', url, body, requestOptions = {}, limiter,
status: res.statusCode,
document: window.document,
window,
ok: res.statusCode >= 200 && res.statusCode <= 299,
ok: resIsOk,
};
}
@ -152,7 +152,9 @@ async function scheduleRequest(method = 'get', url, body, options) {
const limiter = getLimiter(options, url);
const timeout = getTimeout(options, url);
const result = await limiter.schedule(() => Promise.race([request(method, url, body, options, limiter, timeout), timeout]));
const result = await limiter.schedule(() => Promise.race([request(method, url, body, options, limiter), timeout]));
timeout.cancel();
return result;
}

View File

@ -116,7 +116,6 @@ async function initServer() {
res.render(path.join(__dirname, '../../assets/index.ejs'), {
env: JSON.stringify({
sfw: !!req.headers.sfw || Object.prototype.hasOwnProperty.call(req.query, 'sfw'),
auth: config.auth.enabled,
sessionId: req.session.safeId,
}),
});