#488 quick fix for building urls in login redirect. should be refactored