From 3f75c520cca00e4155a169ed7be9580c6f117fd7 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 28 Oct 2021 15:29:16 +0200 Subject: [PATCH] Clear session if login didn't complete --- server/src/routes/api/post/login-arl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/routes/api/post/login-arl.ts b/server/src/routes/api/post/login-arl.ts index eee4fe2..6bc3bdb 100644 --- a/server/src/routes/api/post/login-arl.ts +++ b/server/src/routes/api/post/login-arl.ts @@ -52,6 +52,7 @@ const handler: RequestHandler<{}, {}, {}, RawLoginArlQuery> = async (req, res, _ const testDz = new Deezer() response = await testDz.login_via_arl(...loginParams) } + if (response === LoginStatus.FAILED) sessionDZ[req.session.id] = new Deezer() if (!(await isDeezerAvailable())) response = LoginStatus.NOT_AVAILABLE const returnValue = { status: response, @@ -61,7 +62,7 @@ const handler: RequestHandler<{}, {}, {}, RawLoginArlQuery> = async (req, res, _ currentChild: dz.selected_account } - startQueue(dz) + if (response !== LoginStatus.NOT_AVAILABLE && response !== LoginStatus.FAILED) startQueue(dz) return res.status(200).send(returnValue) }