-
-
Notifications
You must be signed in to change notification settings - Fork 575
Closed
Labels
Bugresolvedif issue is resolved, it will be open until merge with masterif issue is resolved, it will be open until merge with master
Description
terminal::login()
is documented but it don't work quite right.
Login only works when used in terminal option or with push()
. But it should also work when called implicitly after the push()
.
const term = $('body').terminal({
auth() {
term.push(command => {
term.echo(`protected command <white>${command}</white>`);
}, {
prompt: '# '
}).login(function(username, password) {
if (username == 'demo' && password == 'demo') {
return '<TOKEN>';
}
return null;
});
}
}, {
completion: true,
prompt: '$ '
});
This doesn't work when user is already authenticated.
Steps to reproduce
- Open repro
- type auth and demo:demo as login and password
- refresh the page
- type auth
Actual behavior
The terminal is paused, when you press CTRL+D you're logged in.
Metadata
Metadata
Assignees
Labels
Bugresolvedif issue is resolved, it will be open until merge with masterif issue is resolved, it will be open until merge with master