From 1487dcbadcf6275f3ec32d40ff183f495f74c728 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Sun, 14 Nov 2021 13:35:01 +0530 Subject: [PATCH] Fix login with CAS #165 Signed-off-by: Ajay Bura --- package-lock.json | 4 ++-- package.json | 2 +- src/app/templates/auth/Auth.jsx | 8 ++++---- src/client/state/cons.js | 2 +- src/index.scss | 7 ++++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00b66223..60d520e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cinny", - "version": "1.5.0", + "version": "1.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cinny", - "version": "1.5.0", + "version": "1.5.1", "license": "MIT", "dependencies": { "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.4.tgz", diff --git a/package.json b/package.json index b0b6324f..59a01cc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cinny", - "version": "1.5.0", + "version": "1.5.1", "description": "Yet another matrix client", "main": "index.js", "engines": { diff --git a/src/app/templates/auth/Auth.jsx b/src/app/templates/auth/Auth.jsx index 9465a86b..184d7024 100644 --- a/src/app/templates/auth/Auth.jsx +++ b/src/app/templates/auth/Auth.jsx @@ -156,7 +156,7 @@ function Login({ loginFlow, baseUrl }) { const [typeIndex, setTypeIndex] = useState(0); const loginTypes = ['Username', 'Email']; const isPassword = loginFlow?.filter((flow) => flow.type === 'm.login.password')[0]; - const ssoProviders = loginFlow?.filter((flow) => flow.type.match(/^m.login.(sso|cas)$/))[0]; + const ssoProviders = loginFlow?.filter((flow) => flow.type === 'm.login.sso')[0]; const initialValues = { username: '', password: '', email: '', other: '', @@ -248,7 +248,7 @@ function Login({ loginFlow, baseUrl }) { {ssoProviders && isPassword && OR} {ssoProviders && ( @@ -269,7 +269,7 @@ function Register({ registerInfo, loginFlow, baseUrl }) { const [process, setProcess] = useState({}); const formRef = useRef(); - const ssoProviders = loginFlow?.filter((flow) => flow.type.match(/^m.login.(sso|cas)$/))[0]; + const ssoProviders = loginFlow?.filter((flow) => flow.type === 'm.login.sso')[0]; const isDisabled = registerInfo.errcode !== undefined; const { flows, params, session } = registerInfo; @@ -452,7 +452,7 @@ function Register({ registerInfo, loginFlow, baseUrl }) { )} {isDisabled && ssoProviders && ( diff --git a/src/client/state/cons.js b/src/client/state/cons.js index b5822bbc..c02bfa28 100644 --- a/src/client/state/cons.js +++ b/src/client/state/cons.js @@ -1,5 +1,5 @@ const cons = { - version: '1.5.0', + version: '1.5.1', secretKey: { ACCESS_TOKEN: 'cinny_access_token', DEVICE_ID: 'cinny_device_id', diff --git a/src/index.scss b/src/index.scss index 387b0cdc..2aea8d73 100644 --- a/src/index.scss +++ b/src/index.scss @@ -292,9 +292,10 @@ button { } textarea, input, -input[type=text] -input[type=username] -input[type=password] +input[type], +input[type=text], +input[type=username], +input[type=password], input[type=email] { -webkit-appearance: none; -moz-appearance: none;