do not hardcode oauth urls

This commit is contained in:
Son NK 2020-07-16 23:48:47 +02:00
parent 515b3510a8
commit 7f29756230
3 changed files with 28 additions and 27 deletions

View File

@ -9,10 +9,10 @@
<label class="form-label">Authorization endpoint</label>
<div class="input-group mt-2">
<input type="text" disabled value="https://app.simplelogin.io/oauth2/authorize" class="form-control">
<input type="text" disabled value="{{ URL + "/oauth2/authorize" }}" class="form-control">
<span class="input-group-append">
<button
data-clipboard-text="https://app.simplelogin.io/oauth2/authorize"
data-clipboard-text="{{ URL + "/oauth2/authorize" }}"
class="clipboard btn btn-primary" type="button">
<i class="fe fe-clipboard"></i>
</button>
@ -24,10 +24,10 @@
<label class="form-label">Token endpoint</label>
<div class="input-group mt-2">
<input type="text" disabled value="https://app.simplelogin.io/oauth2/token" class="form-control">
<input type="text" disabled value="{{ URL + "/oauth2/token" }}" class="form-control">
<span class="input-group-append">
<button
data-clipboard-text="https://app.simplelogin.io/oauth2/token"
data-clipboard-text="{{ URL + "/oauth2/token" }}"
class="clipboard btn btn-primary" type="button">
<i class="fe fe-clipboard"></i>
</button>
@ -39,10 +39,10 @@
<label class="form-label">UserInfo endpoint</label>
<div class="input-group mt-2">
<input type="text" disabled value="https://app.simplelogin.io/oauth2/userinfo" class="form-control">
<input type="text" disabled value="{{ URL + "/oauth2/userinfo" }}" class="form-control">
<span class="input-group-append">
<button
data-clipboard-text="https://app.simplelogin.io/oauth2/userinfo"
data-clipboard-text="{{ URL + "/oauth2/userinfo" }}"
class="clipboard btn btn-primary" type="button">
<i class="fe fe-clipboard"></i>
</button>

View File

@ -43,7 +43,7 @@
<label class="form-label col">Authorized Redirect URIs</label>
<p class="col text-right">
<small class="text-muted">
<em>redirect_uri</em> must be <b>HTTPS</b> for security reason.
<b>redirect_uri</b> must be <b>HTTPS</b> for security reason.
</small>
</p>
</div>
@ -52,20 +52,20 @@
<div class="alert alert-warning alert-dismissible fade show mb-4" role="alert">
<p>
You haven't added any <a href="https://www.oauth.com/oauth2-servers/redirect-uris/">redirect_uri</a>,
that is the url that will receive the <em>code</em> or <em>access-token</em> in OAuth2 flow.
that is the url that will receive the <b>code</b> or <b>access-token</b> in OAuth2 flow.
</p>
<p>
There's NO NEED to add <em>http://localhost:*</em> as by default,
SimpleLogin <em>whitelists</em> localhost (unlike Facebook).
SimpleLogin <b>whitelists</b> localhost (unlike Facebook).
</p>
<p>
You DO need to add your <em>redirect_uri</em> once your website/app goes live (i.e. deployed on production).
You DO need to add your <b>redirect_uri</b> once your website/app goes live (i.e. deployed on production).
</p>
<p>
The <em>redirect_uri</em> needs to be <b>HTTPS</b> for security reason.
The <b>redirect_uri</b> needs to be <b>HTTPS</b> for security reason.
</p>
<p>
Start by adding your first <em>redirect_uri</em> here 👇
Start by adding your first <b>redirect_uri</b> here 👇
</p>
</div>
{% endif %}

View File

@ -7,24 +7,25 @@
{% endblock %}
{% block default_content %}
<h1>Create new app</h1>
<p>An app can be a website, a SPA webapp or a mobile application</p>
<small>Let's get started integrating SimpleLogin into your app! </small>
<div class="card">
<div class="card-body">
<h1 class="h3">Create new app</h1>
<p>An app can be a website, a SPA webapp or a mobile application</p>
<p>Let's get started integrating SimpleLogin into your app! </p>
<hr>
<form method="post" enctype="multipart/form-data">
{{ form.csrf_token }}
<form method="post" enctype="multipart/form-data">
{{ form.csrf_token }}
<div class="form-group">
<label class="form-label">Display Name</label>
{{ form.name(class="form-control",
<div class="form-group">
<label class="form-label">Display Name</label>
{{ form.name(class="form-control",
placeholder="Usually your product name, e.g. my-super-app.com") }}
{{ render_field_errors(form.name) }}
{{ render_field_errors(form.name) }}
</div>
<button type="submit" class="btn btn-primary">Create</button>
</form>
</div>
<button type="submit" class="btn btn-primary">Create</button>
</form>
</div>
{% endblock %}