Skip to content

Commit

Permalink
feat(web/login): added dev login autofill
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Mar 1, 2023
1 parent 3931a5e commit a07f7bc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions web/standalone/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -300,20 +300,33 @@
<i class="icon-user"></i>
</span>
</div>
<input class="form-control" type="text" name="username" placeholder="Username" required>
<input class="form-control" type="text" name="username" id="frm-username" placeholder="Username" required>
</div>
<div class="input-group mb-4 mx-auto" style="max-width: 280px;">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="icon-lock"></i>
</span>
</div>
<input class="form-control" type="password" name="password" placeholder="Password" required>
<input class="form-control" type="password" name="password" id="frm-password" placeholder="Password" required>
</div>
<div class="row justify-content-center">
<button class="btn btn-primary px-4" type="submit">Login</button>
</div>
</form>
<script>
try {
const rawLocalStorageStr = localStorage.getItem('txAdminDevPassAutofill');
if(rawLocalStorageStr){
const [user, pass] = JSON.parse(rawLocalStorageStr);
document.getElementById('frm-username').value = user;
document.getElementById('frm-password').value = pass;
}
} catch (error) {
console.error('Username/Pass autofill failed', error);
}
</script>
<% } %>
</div>
<% if (message && template !== 'justMessage') { %>
Expand Down

0 comments on commit a07f7bc

Please sign in to comment.