mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-18 12:14:32 -05:00
Merge pull request #42 from omarroth/change-default-account
Change default account type to Invidious accounts
This commit is contained in:
commit
f98d30d36f
@ -1031,7 +1031,7 @@ get "/login" do |env|
|
||||
referer ||= "/feed/subscriptions"
|
||||
|
||||
account_type = env.params.query["type"]?
|
||||
account_type ||= "google"
|
||||
account_type ||= "invidious"
|
||||
|
||||
if account_type == "invidious"
|
||||
captcha = generate_captcha(HMAC_KEY)
|
||||
@ -1148,7 +1148,7 @@ post "/login" do |env|
|
||||
end
|
||||
|
||||
if !tfa_code
|
||||
next env.redirect "/login?tfa=true"
|
||||
next env.redirect "/login?tfa=true&type=google"
|
||||
end
|
||||
|
||||
tl = challenge_results[1][2]
|
||||
|
@ -8,31 +8,14 @@
|
||||
<div class="h-box">
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1-2">
|
||||
<a class="pure-button <% if account_type == "google" %>pure-button-disabled<% end %>" href="/login">Login to Google</a>
|
||||
<a class="pure-button <% if account_type == "invidious" %>pure-button-disabled<% end %>" href="/login">Login/Register</a>
|
||||
</div>
|
||||
<div class="pure-u-1-2">
|
||||
<a class="pure-button <% if account_type == "invidious" %>pure-button-disabled<% end %>" href="/login?type=invidious">Login/Register</a>
|
||||
<a class="pure-button <% if account_type == "google" %>pure-button-disabled<% end %>" href="/login?type=google">Login to Google</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<% if account_type == "google" %>
|
||||
<form class="pure-form pure-form-stacked" action="/login?referer=<%= referer %>" method="post">
|
||||
<fieldset>
|
||||
<label for="email">Email:</label>
|
||||
<input required class="pure-input-1" name="email" type="email" placeholder="Email">
|
||||
|
||||
<label for="password">Password:</label>
|
||||
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
|
||||
|
||||
<% if tfa %>
|
||||
<label for="tfa">Google verification code:</label>
|
||||
<input required class="pure-input-1" name="tfa" type="text" placeholder="Google verification code">
|
||||
<% end %>
|
||||
|
||||
<button type="submit" class="pure-button pure-button-primary">Sign in</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<% elsif account_type == "invidious" %>
|
||||
<% if account_type == "invidious" %>
|
||||
<form class="pure-form pure-form-stacked" action="/login?referer=<%= referer %>&type=invidious" method="post">
|
||||
<fieldset>
|
||||
<label for="email">User ID:</label>
|
||||
@ -50,6 +33,23 @@
|
||||
<button type="submit" name="action" value="register" class="pure-button pure-button-primary">Register</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<% elsif account_type == "google" %>
|
||||
<form class="pure-form pure-form-stacked" action="/login?referer=<%= referer %>" method="post">
|
||||
<fieldset>
|
||||
<label for="email">Email:</label>
|
||||
<input required class="pure-input-1" name="email" type="email" placeholder="Email">
|
||||
|
||||
<label for="password">Password:</label>
|
||||
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
|
||||
|
||||
<% if tfa %>
|
||||
<label for="tfa">Google verification code:</label>
|
||||
<input required class="pure-input-1" name="tfa" type="text" placeholder="Google verification code">
|
||||
<% end %>
|
||||
|
||||
<button type="submit" class="pure-button pure-button-primary">Sign in</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user