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 %> - -
+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 %> -+
- <%= 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 %> +