Skip to content

Commit

Permalink
fix: replace password with token for input
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino committed Nov 9, 2024
1 parent 4a88b66 commit 5eafc15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/assets/js/options.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ function submitSignIn(e) {
setButtonWaitState(elements.signInButton, true);

const email = document.querySelector('form.sign-in #email').value;
const password = document.querySelector('form.sign-in #password').value;
fetchToken(email, password).then(response => {
console.log(response);
const token = document.querySelector('form.sign-in #token').value;

browser.storage.sync.set({
username: response.username,
token: response.token,
}).then(reload);
}).catch(error => {
console.error(error);
showElement(elements.signInError);
setButtonWaitState(elements.signInButton, false);
});
browser.storage.sync
.set({
username: email,
token: token,
})
.then(reload)
.catch(error => {
console.error(error);
showElement(elements.signInError);
setButtonWaitState(elements.signInButton, false);
});
}

function signOut() {
Expand Down
2 changes: 1 addition & 1 deletion src/options.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.form-group
%input.form-control#email{:type => "email", :placeholder => "Email address", :required => "true"}
.form-group
%input.form-control#password{:type => "password", :placeholder => "Password", :required => "true"}
%input.form-control#token{:type => "password", :placeholder => "Token", :required => "true"}
%button.btn.btn-primary.w-100#sign-in-submit{:type => "submit"}
%span.spinner.spinner-border.spinner-border-sm{:ariaHidden => "true", :hidden => "true"}
%span.label Sign In
Expand Down

0 comments on commit 5eafc15

Please sign in to comment.