Added enhancement for onetime login from [#653606] with some changes to match other elements of the module's coding style. Thanks to jww2nc.