mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-12 15:52:44 +02:00
auto user login.
This commit is contained in:
parent
391417d1ea
commit
9d514206ca
2 changed files with 12 additions and 2 deletions
|
@ -157,14 +157,23 @@
|
|||
private password: string = ''
|
||||
|
||||
mounted() {
|
||||
// auto-password fill
|
||||
let password = this.$accessor.password
|
||||
if (this.autoPassword !== null) {
|
||||
this.removeUrlParam('pwd')
|
||||
password = this.autoPassword
|
||||
}
|
||||
|
||||
if (this.$accessor.displayname !== '' && password !== '') {
|
||||
this.$accessor.login({ displayname: this.$accessor.displayname, password })
|
||||
// auto-user fill
|
||||
let displayname = this.$accessor.displayname
|
||||
const usr = new URL(location.href).searchParams.get('usr')
|
||||
if (usr) {
|
||||
this.removeUrlParam('usr')
|
||||
displayname = this.$accessor.displayname || usr
|
||||
}
|
||||
|
||||
if (displayname !== '' && password !== '') {
|
||||
this.$accessor.login({ displayname, password })
|
||||
this.autoPassword = null
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue