X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1bfa822f0bf0b6ff968e229528057da299414457..c426bf92611cff8b5590d5bf77359ea241d82dcb:/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 7afddd6c5e..36b457af0a 100644 --- a/apps/workbench/app/views/users/welcome.html.erb +++ b/apps/workbench/app/views/users/welcome.html.erb @@ -1,38 +1,67 @@ -<% 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 %> -

+<%= javascript_tag do %> + async function controller_password_authenticate(event) { + event.preventDefault() + document.getElementById('login-authenticate-error').innerHTML = ''; + const resp = await fetch('<%= "#{Rails.configuration.Services.Controller.ExternalURL}" %>arvados/v1/users/authenticate', { + method: 'POST', - If you have never used <%= Rails.configuration.site_name %> - before, logging in for the first time will automatically - create a new account. + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({ + username: document.getElementById('login-username').value, + password: document.getElementById('login-password').value, + }), + }) + if (!resp.ok) { + const respj = await resp.json() + document.getElementById('login-authenticate-error').innerHTML = `

${respj.errors[0]}

`; + return + } + var redir = document.getElementById('login-return-to').value + if (redir.indexOf('?') > 0) { + redir += '&' + } else { + redir += '?' + } + const respj = await resp.json() + document.location = redir + "api_token=v2/" + respj.uuid + "/" + respj.api_token + } + // document.getElementById('login-form-tag'). +<% end %> -

+

+
+
- <%= Rails.configuration.site_name %> uses your name and - email address only for identification, and does not retrieve - any other personal information from Google. + <%= raw(Rails.configuration.Workbench.WelcomePageHTML) %> -

-

- <%= link_to arvados_api_client.arvados_login_url(return_to: request.url), class: "pull-right btn btn-primary", :'data-push' => true, :'data-target' => '#top-nav-wrapper' do %> - Log in to <%= Rails.configuration.site_name %> + <% case %> + <% when Rails.configuration.Login.Google.Enable %> + <% when Rails.configuration.Login.OpenIDConnect.Enable %> + <% when Rails.configuration.Login.SSO.Enable %> +

+ <%= 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 %> +
+ <% when Rails.configuration.Login.PAM.Enable %> + <% when Rails.configuration.Login.LDAP.Enable %> + <% when Rails.configuration.Login.Test.Enable %> +
+

username

+

password

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

+ +
+ <% end %> +