better auth, improved redirection handling