mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-14 18:11:23 +01:00
Add sametarget query parameter to not have discord login open in new tab
This commit is contained in:
parent
6dd7f17fb6
commit
b1186fecfe
@ -74,7 +74,8 @@ def guild_embed(guild_id):
|
||||
client_id=config['client-id'],
|
||||
recaptcha_site_key=config["recaptcha-site-key"],
|
||||
css=customcss,
|
||||
cssvariables=parse_css_variable(customcss)
|
||||
cssvariables=parse_css_variable(customcss),
|
||||
same_target=request.args.get("sametarget", False) == "true"
|
||||
)
|
||||
abort(404)
|
||||
|
||||
|
@ -30,6 +30,18 @@
|
||||
<hr>
|
||||
<em>Eg: noscroll=true</em>
|
||||
</li>
|
||||
<li class="collection-item">
|
||||
<strong>sametarget=<boolean></strong> <br>
|
||||
For those who don't want the Discord Login to open in a new tab/window... (<em>Does not work for iframe loaded embeds!!!</em> This is a direct link option only.)
|
||||
<hr>
|
||||
<strong>Avaliable Options:</strong>
|
||||
<ul class="browser-default">
|
||||
<li><strong>true</strong></li>
|
||||
<li><strong>false</strong> (default)</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<em>Eg: sametarget=true</em>
|
||||
</li>
|
||||
<li class="collection-item">
|
||||
<strong>theme=<string></strong> <br>
|
||||
Want your embed to use one of our premade themes? Look no further! <br>
|
||||
|
@ -102,7 +102,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s12 l4">
|
||||
<a id="discordlogin_btn" href="{{ url_for("embed.login_discord", _external=True) }}" class="waves-effect waves-light btn-large" target="_blank">Discord Login</a>
|
||||
<a id="discordlogin_btn" href="{% if not same_target %}{{ url_for("embed.login_discord", _external=True) }}{% else %}{{ url_for("user.login_authenticated", redirect=request.url, _external=True) }}{% endif %}" class="waves-effect waves-light btn-large" {% if not same_target %}target="_blank"{% endif %}>Discord Login</a>
|
||||
<p>*You will be invited into this server.</p>
|
||||
</div>
|
||||
{% if unauth_enabled %}
|
||||
|
Loading…
Reference in New Issue
Block a user