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

Social Auth: Update TOS message to remove mention of creating an account on social login #67057

Merged
merged 8 commits into from
Sep 8, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 34 additions & 30 deletions client/blocks/login/login-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class LoginForm extends Component {
this.loginUser();
};

renderWooCommerce( showSocialLogin = true ) {
renderWooCommerce( { showSocialLogin = true, socialToS } = {} ) {
const isFormDisabled = this.state.isFormDisabledWhileLoading || this.props.isFormDisabled;
const { requestError, socialAccountIsLinking: linkingSocialUser } = this.props;

Expand Down Expand Up @@ -404,6 +404,7 @@ export class LoginForm extends Component {
</div>

<div className="login__form-footer">
<p className="login__social-tos">{ socialToS }</p>
<div className="login__form-action">
<Button
primary
Expand Down Expand Up @@ -485,16 +486,44 @@ export class LoginForm extends Component {
? window.location.origin + pathWithLeadingSlash( this.props.signupUrl )
: getSignupUrl( currentQuery, currentRoute, oauth2Client, locale, pathname, isGutenboarding );

const socialToS = this.props.translate(
// To make any changes to this copy please speak to the legal team
'By continuing with any of the options below, ' +
'you agree to our {{tosLink}}Terms of Service{{/tosLink}} and' +
' have read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
{
components: {
tosLink: (
<a
href={ localizeUrl( 'https://wordpress.com/tos/' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
privacyLink: (
<a
href={ localizeUrl( 'https://automattic.com/privacy/' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
},
}
);

if ( isJetpackWooCommerceFlow ) {
return this.renderWooCommerce();
return this.renderWooCommerce( { socialToS } );
}

if ( isJetpackWooDnaFlow ) {
return this.renderWooCommerce( !! accountType ); // Only show the social buttons after the user entered an email.
return this.renderWooCommerce( {
showSocialLogin: !! accountType, // Only show the social buttons after the user entered an email.
socialToS,
} );
}

if ( isWooOAuth2Client( oauth2Client ) && wccomFrom ) {
return this.renderWooCommerce();
return this.renderWooCommerce( { socialToS } );
}

return (
Expand Down Expand Up @@ -595,32 +624,7 @@ export class LoginForm extends Component {
</div>
</div>

<p className="login__form-terms">
{ this.props.translate(
// To make any changes to this copy please speak to the legal team
'By continuing, ' +
'you agree to our {{tosLink}}Terms of Service{{/tosLink}} and' +
' acknowledge that you have read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
{
components: {
tosLink: (
<a
href={ localizeUrl( 'https://wordpress.com/tos/' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
privacyLink: (
<a
href={ localizeUrl( 'https://automattic.com/privacy/' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
},
}
) }
</p>
<p className="login__form-terms">{ socialToS }</p>

<div className="login__form-action">
<FormsButton primary disabled={ isFormDisabled }>
Expand Down
75 changes: 3 additions & 72 deletions client/blocks/login/social.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import config from '@automattic/calypso-config';
import { Card } from '@automattic/components';
import { localizeUrl } from '@automattic/i18n-utils';
import { localize } from 'i18n-calypso';
import PropTypes from 'prop-types';
import { Component } from 'react';
import { connect } from 'react-redux';
Expand All @@ -24,16 +22,17 @@ class SocialLoginForm extends Component {
recordTracksEvent: PropTypes.func.isRequired,
redirectTo: PropTypes.string,
onSuccess: PropTypes.func.isRequired,
translate: PropTypes.func.isRequired,
loginSocialUser: PropTypes.func.isRequired,
uxMode: PropTypes.string.isRequired,
linkingSocialService: PropTypes.string,
socialService: PropTypes.string,
socialServiceResponse: PropTypes.object,
shouldRenderToS: PropTypes.bool,
};

static defaultProps = {
linkingSocialService: '',
shouldRenderToS: true,
};

reportSocialLoginFailure = ( { service, socialInfo, error } ) => {
Expand Down Expand Up @@ -138,72 +137,6 @@ class SocialLoginForm extends Component {
return `https://${ host + login( { socialService: service } ) }`;
};

renderSocialTos = () => {
const { redirectTo, translate } = this.props;

const isJetpackMagicLinkSignUpFlow =
redirectTo &&
redirectTo.includes( 'jetpack/connect' ) &&
config.isEnabled( 'jetpack/magic-link-signup' );

const tosLink = (
<a
href={ localizeUrl( 'https://wordpress.com/tos/' ) }
target="_blank"
rel="noopener noreferrer"
/>
);
const privacyLink = (
<a
href={ localizeUrl( 'https://automattic.com/privacy/' ) }
target="_blank"
rel="noopener noreferrer"
/>
);

if ( isJetpackMagicLinkSignUpFlow ) {
return (
<>
<p className="login__social-tos">
{ translate(
'By continuing, you agree to our {{tosLink}}Terms of' +
' Service{{/tosLink}} and acknowledge that you have read our' +
' {{privacyLink}}Privacy Policy{{/privacyLink}}.',
{
components: {
tosLink,
privacyLink,
},
}
) }
</p>
<p className="login__social-tos">
{ translate(
'If you continue with Google, Apple, or an email that isn’t registered yet,' +
' you are creating a new WordPress.com account.'
) }
</p>
</>
);
}
return (
<p className="login__social-tos">
{ translate(
"If you continue with Google or Apple and don't already have a WordPress.com account, you" +
' are creating an account, you agree to our' +
' {{tosLink}}Terms of Service{{/tosLink}}, and acknowledge that you have' +
' read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
{
components: {
tosLink,
privacyLink,
},
}
) }
</p>
);
};

render() {
const { redirectTo, uxMode } = this.props;
const uxModeApple = config.isEnabled( 'sign-in-with-apple/redirect' ) ? 'redirect' : uxMode;
Expand Down Expand Up @@ -235,8 +168,6 @@ class SocialLoginForm extends Component {
}
/>
</div>

{ this.renderSocialTos() }
</div>

{ this.props.bearerToken && (
Expand All @@ -262,4 +193,4 @@ export default connect(
createSocialUserFailed,
recordTracksEvent,
}
)( localize( SocialLoginForm ) );
)( SocialLoginForm );
15 changes: 8 additions & 7 deletions client/blocks/login/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,14 @@
box-shadow: none;
}

.login__social-tos a {
color: var( --studio-gray-60 );
text-decoration: underline;
.login__social-tos {
margin: 1.5em auto;
max-width: 330px;

a {
color: var( --color-accent );
text-decoration: underline;
}
}

.jetpack-header__partner-logo-plus svg {
Expand Down Expand Up @@ -327,10 +332,6 @@
box-shadow: none;
}

.login__form-userdata {
margin-bottom: 2em;
}

.login__form label {
font-size: var( --p2-font-size-form-xxs );
color: var( --p2-color-text );
Expand Down
2 changes: 1 addition & 1 deletion client/blocks/signup-form/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ class SignupForm extends Component {
termsOfServiceLink = () => {
const tosText = this.props.translate(
'By creating an account you agree to our {{tosLink}}Terms of Service{{/tosLink}} and' +
' acknowledge that you have read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
' have read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
{
components: {
tosLink: (
Expand Down
5 changes: 2 additions & 3 deletions client/blocks/signup-form/social-signup-tos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ function SocialSignupToS( props ) {
return (
<p className="signup-form__social-buttons-tos">
{ props.translate(
"If you continue with Google or Apple and don't already have a WordPress.com account, you" +
' are creating an account, you agree to our' +
' {{tosLink}}Terms of Service{{/tosLink}}, and acknowledge that you have' +
'If you continue with Google or Apple, you agree to our' +
' {{tosLink}}Terms of Service{{/tosLink}}, and have' +
' read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
{
components: {
Expand Down
1 change: 0 additions & 1 deletion client/blocks/signup-form/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
}

.signup-form__social-buttons-tos a {
color: var( --color-text-inverted );
text-decoration: underline;
}

Expand Down
15 changes: 4 additions & 11 deletions client/layout/masterbar/oauth-client.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@
background: var( --studio-gray-0 );
}

a,
a:visited {
color: inherit;
}

.button {
background-color: var( --studio-gray-0 );
border-radius: 2px;
Expand Down Expand Up @@ -997,15 +992,13 @@
}

.login__form-terms {
font-size: $font-body-small;
line-height: 24px;
margin-top: 8px;
font-size: $font-body-extra-small;
margin-bottom: 1em;
}

.login__form-signup-link {
font-size: $font-body;
line-height: 24px;
padding-top: 0;
}

.login__divider {
Expand Down Expand Up @@ -1093,10 +1086,10 @@
.login__form-userdata {
order: 1;
}
.login__form-action {
.login__form-terms {
order: 2;
}
.login__form-terms {
.login__form-action {
order: 3;
}
.login__form-signup-link {
Expand Down
15 changes: 7 additions & 8 deletions client/login/wp-login/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,15 @@ $image-height: 47px;
}

.login__form-terms,
.login__form-terms {
text-align: left;
color: var( --color-neutral-60 );
font-size: $font-body-extra-small;
}

.login__form-terms a,
.login__form-terms a:hover {
text-align: left;
color: var( --color-neutral-60 );
font-size: $font-body-extra-small;
}

Expand All @@ -264,10 +269,6 @@ $image-height: 47px;
}
}

.login__social-tos a {
color: var( --studio-gray-60 );
}

.wp-login__site-return-link::after {
background: none;
}
Expand Down Expand Up @@ -520,9 +521,7 @@ $image-height: 47px;

.two-factor-authentication__verification-code-form > p,
.login__form-terms,
.login__social-tos,
.login__form-terms a,
.login__social-tos a {
.login__social-tos {
color: var( --studio-gray-50 );
}

Expand Down
3 changes: 0 additions & 3 deletions client/signup/steps/user/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
body.is-section-signup.is-white-signup .signup {
.signup-form.is-horizontal {
.signup-form__terms-of-service-link,
.signup-form__terms-of-service-link a,
.signup-form__social-buttons-tos,
.signup-form__social-buttons-tos a,
.signup-form__social p,
.signup-form__recaptcha-tos,
.logged-out-form__links .logged-out-form__link-item {
Expand All @@ -22,7 +20,6 @@ body.is-section-signup.is-white-signup .signup {
.signup-form__terms-of-service-link a,
.signup-form__social-buttons-tos a,
.signup-form__recaptcha-tos a {
color: inherit;
text-decoration: underline;
}
}
Expand Down
1 change: 0 additions & 1 deletion client/signup/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ body.is-section-signup .layout.gravatar .formatted-header {

.signup-form__terms-of-service-link a,
.signup-form__social-buttons-tos a {
color: var( --studio-gray-50 );
text-decoration: underline;
}

Expand Down