Refact: login returns function, not map containing a fn

+ test