3 Commits
Author SHA1 Message Date
janishutz c27be5f42c fix: improve login page 2026-09-08 14:36:58 +02:00
janishutz 5e322f6c67 revert: "fix: rename config"
This reverts commit 8d6d24a780.
2026-09-08 14:13:50 +02:00
janishutz 8d6d24a780 fix: rename config 2026-09-08 14:13:25 +02:00
4 changed files with 18 additions and 9 deletions
+1
View File
@@ -1,6 +1,7 @@
# ignore node_modules # ignore node_modules
node_modules node_modules
*.secret.json *.secret.json
*.secret.json
apple_private_key.p8 apple_private_key.p8
musicplayerv2-server.zip musicplayerv2-server.zip
dist dist
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"$schema": "../config.schema.json", "$schema": "../config.schema.json",
"mode": "foss", "mode": "hosted",
"clientMode": "sse", "clientMode": "sse",
"webUrl": "http://localhost:8081" "webUrl": "http://localhost:8081"
} }
+7 -5
View File
@@ -15,19 +15,21 @@ import user from './routes/user';
const run = () => { const run = () => {
// FIXME: Use DB instead of memory optionally // FIXME: Use DB instead of memory optionally
const sdkConfig = JSON.parse( fs.readFileSync( path.join(
__dirname,
'/../config/sdk.config.testing.json'
) ).toString() );
const config = JSON.parse( fs.readFileSync( path.join( const config = JSON.parse( fs.readFileSync( path.join(
__dirname, __dirname,
'/../config/config.json' '/../config/config.json'
) ).toString() ) as Config; ) ).toString() ) as Config;
const foss = config.mode !== 'hosted'; const foss = config.mode !== 'hosted';
const sdkConfig = JSON.parse( fs.readFileSync( path.join(
__dirname,
`/../config/sdk.config.${ foss ? 'testing' : 'secret' }.json`
) ).toString() );
const sdk = getLoginSdk( foss ); const sdk = getLoginSdk( foss );
const storeSdk = getStoreSdk( foss ); const storeSdk = getStoreSdk( foss );
const app = express(); const app = express();
logger.info( 'Starting in', foss ? 'FOSS' : 'hosted', 'mode' );
app.use( logger.routeLogging() ); app.use( logger.routeLogging() );
// Load id.janishutz.com SDK and allow signing in // Load id.janishutz.com SDK and allow signing in
@@ -67,7 +69,7 @@ const run = () => {
// Load store sdk // Load store sdk
const storeConfig = JSON.parse( fs.readFileSync( path.join( const storeConfig = JSON.parse( fs.readFileSync( path.join(
__dirname, __dirname,
'/../config/store-sdk.config.testing.json' `/../config/store-sdk.config.${ foss ? 'testing' : 'secret' }.json`
) ).toString() ); ) ).toString() );
storeSdk.configure( storeConfig ); storeSdk.configure( storeConfig );
+6
View File
@@ -15,10 +15,16 @@
sdk.setUp( 'jh-music', 'http://localhost:8080', '/app' ); sdk.setUp( 'jh-music', 'http://localhost:8080', '/app' );
onMounted( async () => { onMounted( async () => {
try {
store.isAuth = await sdk.verify(); store.isAuth = await sdk.verify();
if ( store.isAuth ) if ( store.isAuth )
isAuthorizedHandler(); isAuthorizedHandler();
} catch ( e ) {
if ( e !== 'ERR_401' ) {
throw e;
}
}
isLoggingIn.value = false; isLoggingIn.value = false;