Fixed signups and oauth buttons now only show if enabled
The signup form now works and the oauth buttons are only visible if they have been enabled in the settings.json file
This commit is contained in:
@@ -154,13 +154,17 @@
|
||||
<h1>Sign up to {{ appName }}</h1>
|
||||
<p>Please fill out your details:</p>
|
||||
</div>
|
||||
{% if oauthlogin == "true" %}
|
||||
<div class="oauth-buttons">
|
||||
{% if githublogin == "true" %}
|
||||
<a href="{{ githubUrl }}" class="button">
|
||||
<img src="{{ url_for('static', filename='github-icon.png') }}" alt="Github logo">
|
||||
Sign up with Github
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="divider">Or</div>
|
||||
{% endif %}
|
||||
<div class="emaillogin">
|
||||
<input id="userbox" class="input" type="text" name="username" placeholder="Username">
|
||||
<input id="displaybox" class="input" type="text" name="display" placeholder="Display name">
|
||||
@@ -168,7 +172,7 @@
|
||||
<input id="passbox" class="input" type="password" name="password" placeholder="Password">
|
||||
<input id="codebox" class="input" type="password" name="password" placeholder="Signup Code">
|
||||
</div>
|
||||
<a onclick="login(document.getElementById('userbox').value, document.getElementById('passbox').value, document.getElementById('displaybox').value), document.getElementById('emailbox').value, document.getElementById('codebox').value" class="button loginbutton">Sign Up</a>
|
||||
<a onclick="login(document.getElementById('userbox').value, document.getElementById('passbox').value, document.getElementById('displaybox').value, document.getElementById('emailbox').value, document.getElementById('codebox').value)" class="button loginbutton">Sign Up</a>
|
||||
<p id="incorrectdetailstext" style="display: none;">Incorrect signup code</p>
|
||||
<p id="existingusertext" style="display: none;">User already exists</p>
|
||||
<p id="somethingwrongtext" style="display: none;">Something went wrong</p>
|
||||
@@ -200,8 +204,7 @@
|
||||
} else if (result == "Signups have been disabled" || result == "An error occured") {
|
||||
document.getElementById("somethingwrongtext").style = "display: block;"
|
||||
} else {
|
||||
document.cookie = `auth_token=${result}`;
|
||||
window.location.reload();
|
||||
window.location = "{{ url_for('index') }}";
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error.message)
|
||||
|
||||
Reference in New Issue
Block a user