refactor login redirect and check when syncing owserverobject as well