Fix login with CAS #165

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-11-14 13:35:01 +05:30
parent a4b27fdeab
commit 1487dcbadc
5 changed files with 12 additions and 11 deletions

4
package-lock.json generated
View file

@ -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",

View file

@ -1,6 +1,6 @@
{
"name": "cinny",
"version": "1.5.0",
"version": "1.5.1",
"description": "Yet another matrix client",
"main": "index.js",
"engines": {

View file

@ -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 && <Text className="sso__divider">OR</Text>}
{ssoProviders && (
<SSOButtons
type={ssoProviders.type.match(/^m.login.(sso|cas)$/)[1]}
type="sso"
identityProviders={ssoProviders.identity_providers}
baseUrl={baseUrl}
/>
@ -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 && (
<SSOButtons
type={ssoProviders.type.match(/^m.login.(sso|cas)$/)[1]}
type="sso"
identityProviders={ssoProviders.identity_providers}
baseUrl={baseUrl}
/>

View file

@ -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',

View file

@ -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;