Skip to content

Commit

Permalink
Fix login with CAS #165
Browse files Browse the repository at this point in the history
Signed-off-by: Ajay Bura <[email protected]>
  • Loading branch information
ajbura committed Nov 14, 2021
1 parent a4b27fd commit 1487dcb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cinny",
"version": "1.5.0",
"version": "1.5.1",
"description": "Yet another matrix client",
"main": "index.js",
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions src/app/templates/auth/Auth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand Down Expand Up @@ -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}
/>
Expand All @@ -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;

Expand Down Expand Up @@ -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}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/client/state/cons.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
7 changes: 4 additions & 3 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1487dcb

Please sign in to comment.