From d4be955a8599ab42465e0874ce6909ad9cf4ca60 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sat, 22 Aug 2020 21:37:03 +0200 Subject: [PATCH] Add support for multiple oauth login methods Depends on https://github.com/runelite/runelite/pull/12356 Signed-off-by: Tomas Slusny --- .eslintrc | 3 +++ src/components/navigation.js | 40 ++++++++++++++++++++++++++---------- src/modules/account.js | 4 ++-- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index 06a742c859..57aa770404 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,5 +5,8 @@ "pragma": "h", "version": "16.0" } + }, + "rules": { + "jsx-a11y/anchor-is-valid": "off" } } diff --git a/src/components/navigation.js b/src/components/navigation.js index e058fabde6..dcf71dd75e 100644 --- a/src/components/navigation.js +++ b/src/components/navigation.js @@ -64,7 +64,6 @@ const Navigation = ({ dark, login, loggedIn, username }) => ( - + + ) : ( + + )} diff --git a/src/modules/account.js b/src/modules/account.js index 9813df1feb..17393ce251 100644 --- a/src/modules/account.js +++ b/src/modules/account.js @@ -17,7 +17,7 @@ export const { resetSession } = createActions( { - LOGIN: () => async (dispatch, getState) => { + LOGIN: provider => async (dispatch, getState) => { const version = getLatestRelease(getState()) const localUuid = getState().account.uuid const baseUrl = getBaseUrl() @@ -26,7 +26,7 @@ export const { loadingPane.focus() const authResponse = await runeliteApi( - `runelite-${version}/account/login?uuid=${localUuid}`, + `runelite-${version}/account/login?uuid=${localUuid}&provider=${provider}`, { method: 'GET' }