Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Remove most clientside references to signing up
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlovin committed Aug 23, 2021
1 parent a0ae415 commit 9890cb4
Show file tree
Hide file tree
Showing 19 changed files with 8 additions and 580 deletions.
4 changes: 1 addition & 3 deletions api/routes/auth/create-signin-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export const createSigninRoutes = (
// redirecting to the right place and handling tokens
callbacks: [
passport.authenticate(strategy, {
failureRedirect: IS_PROD
? '/new/user'
: 'http://localhost:3000/new/user',
failureRedirect: '/',
}),
(req: express$Request, res: express$Response) => {
// $FlowIssue
Expand Down
40 changes: 0 additions & 40 deletions cypress/integration/login_spec.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
describe('Sign up', () => {
beforeEach(() => {
cy.visit('/new/user');
});

it('should only allow github signup', () => {
cy.get('[data-cy="login-page"]').should('be.visible');
cy.get('[href*="/auth/github"]').should('be.visible');
cy.get('[href*="/login"]').should('be.visible');
cy.get('[href*="github.com/withspectrum/code-of-conduct"]').should(
'be.visible'
);
});
});

describe('Log in', () => {
beforeEach(() => {
cy.visit('/login');
Expand All @@ -24,31 +9,10 @@ describe('Log in', () => {
cy.get('[href*="/auth/facebook"]').should('be.visible');
cy.get('[href*="/auth/google"]').should('be.visible');
cy.get('[href*="/auth/github"]').should('be.visible');
cy.get('[href*="/new/user"]').should('be.visible');

cy.get('[href*="github.com/withspectrum/code-of-conduct"]').should(
'be.visible'
);
});
});

describe('Community Signup View', () => {
beforeEach(() => {
cy.visit('/spectrum/login');
});

it('should render', () => {
cy.get('[data-cy="community-login-page"]').should('be.visible');
cy.get('[href*="/auth/github?r=http://localhost:3000/spectrum"]').should(
'be.visible'
);
cy.get('[href*="github.com/withspectrum/code-of-conduct"]').should(
'be.visible'
);

cy.get('[href*="/login?r=http://localhost:3000/spectrum"]').should(
'be.visible'
);
});
});

Expand Down Expand Up @@ -79,9 +43,6 @@ describe('Redirect paths', () => {
cy.get('[href*="/auth/github?r=http://localhost:3000/spectrum"]').should(
'be.visible'
);
cy.get('[href*="/new/user?r=http://localhost:3000/spectrum"]').should(
'be.visible'
);
});

it('should preserve thread redirect paths', () => {
Expand All @@ -106,6 +67,5 @@ describe('Redirect paths', () => {
cy.get(`[href*="/auth/facebook?r=${path}"]`).should('be.visible');
cy.get(`[href*="/auth/google?r=${path}"]`).should('be.visible');
cy.get(`[href*="/auth/github?r=${path}"]`).should('be.visible');
cy.get(`[href*="/new/user?r=${path}"]`).should('be.visible');
});
});
143 changes: 0 additions & 143 deletions cypress/integration/user/new_user_spec.js

This file was deleted.

21 changes: 0 additions & 21 deletions public/img/fills/signup.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/components/chatInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ const ChatInput = (props: Props) => {
);
}

if (!props.currentUser) {
// user is trying to send a message without being signed in
return props.dispatch(openModal('LOGIN_MODAL', {}));
}

scrollToBottom();

if (mediaFile) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/joinChannelWrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const JoinChannel = (props: Props) => {
e && e.preventDefault() && e.stopPropogation();

if (!currentUser || !currentUser.id) {
return dispatch(openModal('LOGIN_MODAL'));
return dispatch(addToastWithTimeout('error', 'You must be logged in.'));
}

setIsLoading(true);
Expand Down
2 changes: 1 addition & 1 deletion src/components/loginButtonSet/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const GithubSigninButton = (props: ButtonProps) => {
>
<GithubButton showAfter={showAfter} preferred={preferred}>
<Icon glyph={'github'} />
<Label>{githubOnly ? 'Sign up' : 'Log in'} with GitHub</Label>
<Label>Log in with GitHub</Label>
</GithubButton>
</A>
);
Expand Down
12 changes: 0 additions & 12 deletions src/components/loginButtonSet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,6 @@ class LoginButtonSet extends React.Component<Props> {
}
showAfter={preferredSigninMethod === 'github'}
/>

{!githubOnly && (
<div style={{ gridColumn: 'span 2' }}>
<div style={{ padding: '16px' }} />
<OutlineButton
css={{ width: '100%' }}
to={`/new/user?r=${postAuthRedirectPath}`}
>
New to Spectrum? Click here to sign up.
</OutlineButton>
</div>
)}
</Container>
</React.Fragment>
);
Expand Down
109 changes: 0 additions & 109 deletions src/components/modals/LoginModal/index.js

This file was deleted.

Loading

0 comments on commit 9890cb4

Please sign in to comment.