X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c70fde67e6f6937dd63889da4df185003ce44e60..e522f0285d8214484d09e9342c97a1b97d7768c5:/apps/workbench/app/views/users/welcome.html.erb diff --git a/apps/workbench/app/views/users/welcome.html.erb b/apps/workbench/app/views/users/welcome.html.erb index 4541d5be29..92fd6dad46 100644 --- a/apps/workbench/app/views/users/welcome.html.erb +++ b/apps/workbench/app/views/users/welcome.html.erb @@ -1,50 +1,75 @@ -<% content_for :breadcrumbs do raw '' end %> - -
-
-
- <%= image_tag "dax.png", style: "width: 147px; height: 197px; max-width: 25%; margin-right: 2em", class: 'pull-left' %> - -

Please log in.

+<%# Copyright (C) The Arvados Authors. All rights reserved. -

+SPDX-License-Identifier: AGPL-3.0 %> - The "Log in" button below will show you a Google sign-in page. - After you assure Google that you want to log in here with your - Google account, you will be redirected back here to - <%= Rails.configuration.site_name %>. - -

+<% content_for :breadcrumbs do raw '' end %> - If you have never used <%= Rails.configuration.site_name %> - before, logging in for the first time will automatically - create a new account. +<%= javascript_tag do %> + function controller_password_authenticate(event) { + event.preventDefault() + document.getElementById('login-authenticate-error').innerHTML = ''; + fetch('<%= "#{Rails.configuration.Services.Controller.ExternalURL}" %>arvados/v1/users/authenticate', { + method: 'POST', -

+ headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({ + username: document.getElementById('login-username').value, + password: document.getElementById('login-password').value, + }), + }).then(function(resp) { + if (!resp.ok) { + resp.json().then(function(respj) { + document.getElementById('login-authenticate-error').innerHTML = "

"+respj.errors[0]+"

"; + }); + return; + } - <%= Rails.configuration.site_name %> uses your name and - email address only for identification, and does not retrieve - any other personal information from Google. + var redir = document.getElementById('login-return-to').value + if (redir.indexOf('?') > 0) { + redir += '&' + } else { + redir += '?' + } + resp.json().then(function(respj) { + document.location = redir + "api_token=v2/" + respj.uuid + "/" + respj.api_token; + }); + }); + } + function clear_authenticate_error() { + document.getElementById('login-authenticate-error').innerHTML = ""; + } +<% end %> -

-

- - <%= form_tag(arvados_api_client.arvados_login_url(), :method => :get, :authenticity_token => false) do %> - <%= hidden_field_tag 'return_to', request.url %> -

+
+
+
- <%# Todo: add list of external authentications providers to - discovery document, then generate the option list on the fly. Right - now, don't provide 'auth_provider' and hope that the default one is - the one we want. %> + <%= raw(Rails.configuration.Workbench.WelcomePageHTML) %> - <%#= select_tag "auth_provider", "".html_safe, class: "form-control", style: "width: 15em; display: inline" %> - <%= button_tag type: 'submit', name: nil, class: "btn btn-primary" do %> - Log in to <%= Rails.configuration.site_name %> + <% case %> + <% when Rails.configuration.Login.PAM.Enable, + Rails.configuration.Login.LDAP.Enable, + Rails.configuration.Login.Test.Enable %> +
+

username

+

password

+ " id="login-return-to"> +

+ +
+ <% else %> +
+ <%= link_to arvados_api_client.arvados_login_url(return_to: request.url), class: "btn btn-primary" do %> + Log in to <%= Rails.configuration.Workbench.SiteName %> + <% end %>
- <% end %> -

+ <% end %> +