Refactoring signin stuff

but it's at least 12 calls of ```util.get_next_url()```  instead of one