diff --git a/common/js/auth-buttons.js b/common/js/auth-buttons.js index 2301f23ce..df2c1059f 100644 --- a/common/js/auth-buttons.js +++ b/common/js/auth-buttons.js @@ -39,7 +39,7 @@ // Log the user in on the client and the server async function login () { - alert(`login from this page is no more possible.\n\nYou must ask the pod owner to modify this page or remove it.`) + alert('login from this page is no more possible.\n\nYou must ask the pod owner to modify this page or remove it.') /* deprecated since inrupt/solid-auth-client const session = await auth.popupLogin() if (session) { diff --git a/common/js/index-buttons.js b/common/js/index-buttons.js index c71e10c70..1963dd5a3 100644 --- a/common/js/index-buttons.js +++ b/common/js/index-buttons.js @@ -1,44 +1,43 @@ 'use strict' -var keyname = 'SolidServerRootRedirectLink'; -function register() { - alert(2); window.location.href = "/register"; +const keyname = 'SolidServerRootRedirectLink' +function register () { + alert(2); window.location.href = '/register' } -document.addEventListener('DOMContentLoaded', async function() { - const authn = UI.authn - const authSession = UI.authn.authSession +document.addEventListener('DOMContentLoaded', async function () { + const authn = UI.authn + const authSession = UI.authn.authSession - if (!authn.currentUser()) await authn.checkUser(); - let user = authn.currentUser(); + if (!authn.currentUser()) await authn.checkUser() + let user = authn.currentUser() - // IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT - if( user ) { - window.localStorage.setItem(keyname, user.uri); - await authSession.logout(); - } - else { - let webId = window.localStorage.getItem(keyname); + // IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT + if (user) { + window.localStorage.setItem(keyname, user.uri) + await authSession.logout() + } else { + let webId = window.localStorage.getItem(keyname) - // IF NOT LOGGED IN AND COOKIE EXISTS: REMOVE COOKIE, HIDE WELCOME, SHOW LINK TO PROFILE - if( webId ) { - window.localStorage.removeItem(keyname); - document.getElementById('loggedIn').style.display = "block"; - document.getElementById('loggedIn').innerHTML = `
Your WebID is : ${webId}.
Visit your profile to log into your Pod.
`; - } + // IF NOT LOGGED IN AND COOKIE EXISTS: REMOVE COOKIE, HIDE WELCOME, SHOW LINK TO PROFILE + if (webId) { + window.localStorage.removeItem(keyname) + document.getElementById('loggedIn').style.display = 'block' + document.getElementById('loggedIn').innerHTML = `Your WebID is : ${webId}.
Visit your profile to log into your Pod.
` + } - // IF NOT LOGGED IN AND COOKIE DOES NOT EXIST - // SHOW WELCOME, SHOW LOGIN BUTTON - // HIDE LOGIN BUTTON, ADD REGISTER BUTTON - else { - let loginArea = document.getElementById('loginStatusArea'); - let html = `` - let span = document.createElement("span") - span.innerHTML = html - loginArea.appendChild(span); - loginArea.appendChild(UI.login.loginStatusBox(document, null, {})) - const logInButton = loginArea.querySelectorAll('input')[1]; - logInButton.value = "Log in to see your WebID"; - const signUpButton = loginArea.querySelectorAll('input')[2]; - signUpButton.style.display = "none"; - } + // IF NOT LOGGED IN AND COOKIE DOES NOT EXIST + // SHOW WELCOME, SHOW LOGIN BUTTON + // HIDE LOGIN BUTTON, ADD REGISTER BUTTON + else { + let loginArea = document.getElementById('loginStatusArea') + let html = '' + let span = document.createElement('span') + span.innerHTML = html + loginArea.appendChild(span) + loginArea.appendChild(UI.login.loginStatusBox(document, null, {})) + const logInButton = loginArea.querySelectorAll('input')[1] + logInButton.value = 'Log in to see your WebID' + const signUpButton = loginArea.querySelectorAll('input')[2] + signUpButton.style.display = 'none' } -}) \ No newline at end of file + } +}) diff --git a/default-views/auth/reset-link-sent.hbs b/default-views/auth/reset-link-sent.hbs index 1059f963a..fc4477469 100644 --- a/default-views/auth/reset-link-sent.hbs +++ b/default-views/auth/reset-link-sent.hbs @@ -14,7 +14,7 @@A Reset Password link has been sent to your email.
+A Reset Password link has been from the associated email account.