Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming Oauth to cas #160

Merged
merged 3 commits into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"private": true,
"scripts": {
"clean": "rm -f public/bundle-* && rm -f public/style-* && rm -f bin/server.js",
"clean": "rm -f public/bundle* && rm -f public/style* && rm -f bin/server.js",
"build:server": "webpack -p --config config/webpack.server.js",
"build:client": "webpack -p --config config/webpack.config.js",
"build:server:test": "webpack --config config/webpack.server.js",
Expand All @@ -22,7 +22,7 @@
"test:watch": "mocha --watch --reporter nyan",
"dev": "babel-node bin/dev.js",
"start": "node bin/server.js",
"deploy": "mkdir -p ./prod && cp -rf ./views ./prod && cp -rf ./bin ./prod && cp -rf ./public ./prod",
"deploy": "mkdir -p ./prod && cp -rf ./views ./prod && cp -rf ./bin ./prod && rm -f ./prod/public/bundle* && rm -f ./prod/public/style* && cp -rf ./public ./prod",
"exportStrings": "babel-node bin/manageTranslations.js",
"format": "./node_modules/prettier/bin/prettier.js --single-quote --write 'src/**/*.js'"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import FormBox from '../../widgets/FormBox';
import { CASAuthenticationButtonField, SelectField } from '../Fields';
import SubmitButton from '../SubmitButton';

const RegistrationCASOauth = ({
const RegistrationCAS = ({
submitting,
handleSubmit,
submitSucceeded,
submitFailed,
anyTouched,
instances = Map(),
invalid
}) => (
}) =>
<FormBox
title={
<FormattedMessage
Expand Down Expand Up @@ -83,7 +83,7 @@ const RegistrationCASOauth = ({
/>

<ResourceRenderer resource={instances.toArray()}>
{(...instances) => (
{(...instances) =>
<Field
name="instanceId"
required
Expand All @@ -98,13 +98,11 @@ const RegistrationCASOauth = ({
{ key: '', name: '...' },
...instances.map(({ id: key, name }) => ({ key, name }))
]}
/>
)}
/>}
</ResourceRenderer>
</FormBox>
);
</FormBox>;

RegistrationCASOauth.propTypes = {
RegistrationCAS.propTypes = {
instances: ImmutablePropTypes.map.isRequired,
handleSubmit: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
Expand Down Expand Up @@ -145,7 +143,7 @@ const initialValues = {
};

export default reduxForm({
form: 'registration-cas-oauth',
form: 'registration-cas',
initialValues,
validate
})(RegistrationCASOauth);
})(RegistrationCAS);
1 change: 1 addition & 0 deletions src/components/forms/RegistrationCAS/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default from './RegistrationCAS';
1 change: 0 additions & 1 deletion src/components/forms/RegistrationCASOauth/index.js

This file was deleted.

6 changes: 3 additions & 3 deletions src/pages/Registration/Registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Row, Col } from 'react-bootstrap';
import PageContent from '../../components/layout/PageContent';
import RegistrationForm from '../../components/forms/RegistrationForm';
import ExternalRegistrationForm from '../../components/forms/ExternalRegistrationForm';
import RegistrationCASOauth from '../../components/forms/RegistrationCASOauth';
import RegistrationCAS from '../../components/forms/RegistrationCAS';

import {
createAccount,
Expand Down Expand Up @@ -89,9 +89,9 @@ class Register extends Component {
</Col>}
{process.env.ALLOW_CAS_REGISTRATION === 'true' &&
<Col lg={4} md={6} mdOffset={0} sm={8} smOffset={2}>
<RegistrationCASOauth
<RegistrationCAS
instances={instances}
onSubmit={createExternalAccount('oauth')}
onSubmit={createExternalAccount('cas')}
/>
</Col>}
</Row>
Expand Down
2 changes: 1 addition & 1 deletion src/redux/modules/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const loginServices = {
local: LOCAL_LOGIN,
external: {
CAS_UK: 'cas-uk',
CAS_UK_TICKET: 'cas-uk/oauth'
CAS_UK_TICKET: 'cas-uk/cas'
}
};

Expand Down