mirror of
https://github.com/janishutz/MusicPlayer.git
synced 2026-09-10 14:25:24 +02:00
Compare commits
3
Commits
946ba84518
...
c27be5f42c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c27be5f42c | ||
|
|
5e322f6c67 | ||
|
|
8d6d24a780 |
@@ -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,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
@@ -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 );
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user