Emit a login-ok event
Typo
Naming
Update docs
Fix event
Fix mode validation