Skip to content

Commit

Permalink
fix(fly): add terms sentence (#58013)
Browse files Browse the repository at this point in the history
request by legal:
https://www.notion.so/sentry/Fly-partnership-changes-to-meet-legal-standards-471fca1333804ccbac3d7f5e398ef77d?pvs=4#b097800bcb8b4c8d9c3dcf22f54d0170


before (and after if provider.is_partner is False. It is True only for
Fly):
![Screenshot 2023-10-12 at 1 13 59
PM](https://github.com/getsentry/sentry/assets/132939361/287f6eab-bee6-4729-93c9-d9255fd214a3)

after:
![Screenshot 2023-10-12 at 12 58 13
PM](https://github.com/getsentry/sentry/assets/132939361/e6271d6b-7745-4e62-b8e7-d5c99ebb9cd4)

Hovering on links shows that they're clickable:
![Screenshot 2023-10-12 at 1 07 00
PM](https://github.com/getsentry/sentry/assets/132939361/e023f0fb-63c0-415f-bfee-c4970a64c9e0)

Clicking on links will open a new tab.
  • Loading branch information
sentaur-athena authored Oct 13, 2023
1 parent 53bd572 commit 3b9a4b0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/sentry/templates/sentry/organization-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,15 @@ <h3>{{ organization.name }}</h3>
Sign in with your {{ provider_name }} account to continue.
{% endif %}
</p>

<p><button type="submit" class="btn btn-default btn-login-{{ provider_key }}">
<span class="provider-logo {{ provider_key }}"></span> Login with {{ provider_name }}
</button></p>
<div class="auth-terms">
{% if terms_url and privacy_policy_url and is_provider_partner %}
By clicking the login button you are accepting Sentry’s <a href="{{ terms_url }}" target="_blank">terms of service</a> and <a href="{{ privacy_policy_url }}" target="_blank">privacy policy</a>.
{% endif %}
</div>
</p>
</div>
</form>
{% else %}
Expand Down
7 changes: 6 additions & 1 deletion src/sentry/web/frontend/auth_organization_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from sentry.utils.auth import initiate_login
from sentry.web.frontend.auth_login import AuthLoginView

TERMS_URL = "https://sentry.io/terms/"
PRIVACY_POLICY_URL = "https://sentry.io/privacy/"


class AuthOrganizationLoginView(AuthLoginView):
def respond_login(self, request: Request, context, *args, **kwargs) -> HttpResponse:
Expand All @@ -37,14 +40,16 @@ def handle_sso(self, request: Request, organization: RpcOrganization, auth_provi
return helper.current_step()

provider = auth_provider.get_provider()

context = {
"CAN_REGISTER": False,
"organization": organization,
"provider_key": provider.key,
"provider_name": provider.name,
"authenticated": request.user.is_authenticated,
"referrer": referrer,
"terms_url": TERMS_URL,
"privacy_policy_url": PRIVACY_POLICY_URL,
"is_provider_partner": provider.is_partner,
}

return self.respond("sentry/organization-login.html", context)
Expand Down
10 changes: 10 additions & 0 deletions static/less/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ body.auth {
}
}

.auth-terms {
color: @gray-light;
a {
color: @gray-light;
&:hover {
color: @gray-dark;
}
}
}

.auth-toggle {
display: flex;
}
Expand Down

0 comments on commit 3b9a4b0

Please sign in to comment.