           redirectToTeam: (person, alternatePath) ->
             Team.first { 'members._id': person._id }, (error, team) =>
               if team?
-                @redirect '/teams/' + team.id()
+                @redirect '/teams/' + team.toParam()
               else
                 @redirect (alternatePath or '/')
           redirectToLogin: ->


get '/me', ->
  if @currentPerson?
    @redirect "/people/#{@currentPerson.id()}/edit"
  else
    @redirectToLogin()


            @res.send 'OK', 200
          else
            # TODO flash "Sent a new invitation to $@person.email"
            @redirect '/teams/' + team.toParam()

# sign in
get '/login', ->
