Skip to content

Commit

Permalink
rename 'upgrade' to 'link credentials'
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Jul 9, 2023
1 parent 60b07c4 commit 0972526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<label for="password" class="form-label w-25 text-end pe-2">Password</label>
<input type="password" class="form-control d-inline w-50" name="password">
</div>
<button type="submit" id="convertAccBtn" type="button" class="btn btn-primary mt-3" onClick="onUpgradeAccountBtnClick()">Upgrade To Permanent Account</button>
<button type="submit" id="convertAccBtn" type="button" class="btn btn-primary mt-3" onClick="onLinkCredentialsBtnClick()">Link Account Credentials</button>
</form>
</div>

Expand Down
6 changes: 3 additions & 3 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function logout () {
hideElement('#room');
}

async function upgradeAccountToPermanent(email, password) {
async function linkAccountCredentials(email, password) {
try {
const credential = EmailAuthProvider.credential(email, password);
const userCredential = await linkWithCredential(auth.currentUser, credential)
Expand Down Expand Up @@ -78,14 +78,14 @@ window.onLogoutBtnClick = function () {
hideElement('#logout');
}

window.onUpgradeAccountBtnClick = async function() {
window.onLinkCredentialsBtnClick = async function() {
toggleDisabled('#convertAccBtn');

const email = document.querySelector('#convertAcc input[name=email]').value;
const password = document.querySelector('#convertAcc input[name=password]').value;

try {
await upgradeAccountToPermanent(email, password);
await linkAccountCredentials(email, password);
document.getElementById('convertAcc').innerText = "Account successfully upgraded! (" + email + ")";

} catch (e) {
Expand Down

0 comments on commit 0972526

Please sign in to comment.