Automatically log in.

Functionality copied to the Release build.