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

Add a Warning pre-auth page for Zoom users #142 #194

Merged
merged 4 commits into from
Mar 16, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# Setup
- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.x'
- run: pip install pipenv

# Install the stack and run the tests
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ invoke = ">=1.4"
# https://github.com/docker/compose/issues/6839
colorama = {version = ">=0.4, <1"}
pypiwin32 = {version = "*", sys_platform = "== 'win32'"}
pywin32 = {version = "*", sys_platform = "== 'win32'"}
#pywin32 = {version = "*", sys_platform = "== 'win32'"}

[requires]
python_version = "3"
Expand Down
159 changes: 74 additions & 85 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions config/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ discord_authenticate:
zoom_authenticate:
path: /auth/zoom
controller: JoliCode\SecretSanta\Controller\ZoomController::authenticate

zoom_pre_auth_warning:
path: /intro/zoom
controller: JoliCode\SecretSanta\Controller\ZoomController::preAuthWarning
7 changes: 7 additions & 0 deletions src/Controller/ZoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ public function __construct(string $zoomClientId, string $zoomClientSecret, Rout
$this->zoomClientSecret = $zoomClientSecret;
}

public function preAuthWarning()
{
return $this->render('santa/pre_auth_warning.html.twig', [
'title' => 'Zoom Secret Santa warning',
]);
}

/**
* Ask for Zoom authentication and store the AccessToken in Session.
*/
Expand Down
2 changes: 1 addition & 1 deletion templates/content/homepage.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<a class="action hvr-buzz action-discord" href="{{ path('run', { application: 'discord' }) }}">
<i class="custom-fa-discord"></i> Run on Discord
</a>
<a class="action hvr-buzz action-zoom" href="{{ path('run', { application: 'zoom' }) }}">
<a class="action hvr-buzz action-zoom" href="{{ path('zoom_pre_auth_warning') }}">
<i class="custom-fa-zoom"></i> Run on Zoom
<sup style="position:absolute;top:8px;right:4px;font-size: 0.6em;">beta</sup>
</a>
Expand Down
35 changes: 35 additions & 0 deletions templates/santa/pre_auth_warning.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}

{% block content %}
<div class="content error-page">
<div class="is-center">
<h2>⚠️ Zoom support may not be what you expect ⚠️</h2>

<p>
This application can only show and send private messages to <strong>your users</strong>. That means the users you
can see as a Zoom Admin here: <a href="https://zoom.us/account/user">https://zoom.us/account/user</a>.
</p>

<p>
We cannot show you your contacts, this is a known issue of the Zoom API and you
can found <a href="https://github.com/jolicode/secret-santa/issues/142#issuecomment-781204731">more information here</a>.
</p>
</div>
</div>
<div class="jumbotron" style="padding: 20px 0;">
<div class="jumbotron-inner">
<a class="action hvr-buzz action-zoom" href="{{ path('run', { application: 'zoom' }) }}">
<i class="custom-fa-zoom"></i> Run on Zoom anyway!
<sup style="position:absolute;top:8px;right:4px;font-size: 0.6em;">beta</sup>
</a>
</div>
</div>
<div class="content error-page">
<div class="is-center">
<p>
Sorry for any disappointment!<br>
<em>(Also, this application is open-source, you can help!)</em>
</p>
</div>
</div>
{% endblock content %}