fix: improve login page

This commit is contained in:
2026-09-08 14:36:58 +02:00
parent 5e322f6c67
commit c27be5f42c
4 changed files with 18 additions and 9 deletions
+1
View File
@@ -1,6 +1,7 @@
# ignore node_modules
node_modules
*.secret.json
*.secret.json
apple_private_key.p8
musicplayerv2-server.zip
dist
+1 -1
View File
@@ -1,6 +1,6 @@
{
"$schema": "../config.schema.json",
"mode": "foss",
"mode": "hosted",
"clientMode": "sse",
"webUrl": "http://localhost:8081"
}
+7 -5
View File
@@ -15,19 +15,21 @@ import user from './routes/user';
const run = () => {
// 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(
__dirname,
'/../config/config.json'
) ).toString() ) as Config;
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 storeSdk = getStoreSdk( foss );
const app = express();
logger.info( 'Starting in', foss ? 'FOSS' : 'hosted', 'mode' );
app.use( logger.routeLogging() );
// Load id.janishutz.com SDK and allow signing in
@@ -67,7 +69,7 @@ const run = () => {
// Load store sdk
const storeConfig = JSON.parse( fs.readFileSync( path.join(
__dirname,
'/../config/store-sdk.config.testing.json'
`/../config/store-sdk.config.${ foss ? 'testing' : 'secret' }.json`
) ).toString() );
storeSdk.configure( storeConfig );
+6
View File
@@ -15,10 +15,16 @@
sdk.setUp( 'jh-music', 'http://localhost:8080', '/app' );
onMounted( async () => {
try {
store.isAuth = await sdk.verify();
if ( store.isAuth )
isAuthorizedHandler();
} catch ( e ) {
if ( e !== 'ERR_401' ) {
throw e;
}
}
isLoggingIn.value = false;