fix(backend): don't send connect type on own check

This commit is contained in:
2026-09-07 12:46:28 +02:00
parent 8a83326d60
commit 68bbfa7896
3 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ const run = () => {
// Load extra routes
devtoken.routes( app, foss );
room.routes( app, foss );
user.routes( app, foss, config );
user.routes( app, foss );
app.use( ( _request: express.Request, response: express.Response ) => {
+1
View File
@@ -13,6 +13,7 @@ import {
const routes = ( app: express.Application, foss: boolean ) => {
const sdk = getLoginSdk( foss );
// FIXME: Here, if not in sse mode, simply close the connection after sending 'poll'
app.get( '/room/:id/connect', corsManager.middleware( false ), sseMiddleware( 'client' ) );
app.get( '/room/:id/poll', corsManager.middleware( false ), ( request: express.Request, response: express.Response ) => {
+3 -12
View File
@@ -6,9 +6,6 @@ import {
getUserFile,
writeUserFile
} from '../../manager/users';
import {
Config
} from '../../dtype/config';
import bodyParser from 'body-parser';
import express from 'express';
import {
@@ -19,21 +16,15 @@ import {
} from '../../manager/users/ownership';
import logger from '../../logger';
const routes = ( app: express.Application, foss: boolean, config: Config ) => {
const routes = ( app: express.Application, foss: boolean ) => {
const sdk = getLoginSdk( foss );
const ownership = getOwnershipManager( foss );
app.get( '/user/owned', sdk.loginCheck(), async ( request: express.Request, response: express.Response ) => {
if ( await ownership.getOwned( request ) )
response.send( JSON.stringify( {
'status': true,
'shareMode': config.clientMode
} ) );
response.send( true );
else
response.send( JSON.stringify( {
'status': false,
'shareMode': config.clientMode
} ) );
response.send( true );
} );
app.get(