gun
gun copied to clipboard
strange behavior of gun.user().recall()
Steps to reproduce:
- gun.user().create("myLogin", "myPassword")
- gun.user().is.alias => "myLogin" // correct
- gun.user().recall({sessionStorage: true})
- gun.user().is.alias => {pub: "...", epub: "...", priv: "...", epriv: "..."} // strange
is this a feature?
couple days ago it confused me too.
btw if you want the alias this works for both scenarios:
let name = '';
gun
.user(user?._.sea?.pub)
.get('alias')
.once((alias) => (name = alias));
@janbkrejci @ulvido apologies, this is a bug indeed. sessionStorage logs in using keypair not password, which is then badly getting set to .is which is clearly a no-no. Thank you for reporting! (I've noted this in my code already, so hopefully be fixed in next version)
update: gun.user().is.alias after recalling user from session storage now contains just the pub key value, not an object with all four keys.