Forget about a body for the response if the login was succesful and redirect to the profile page.
HTTP::redirect(Route::get('route that routes to the profile page')->uri(/* Just guessing */'action' => 'profile'));
Read up on Post/Redirect/Get.
Example route(s) as requested
Route::set('home', '')
->defaults(array(
'controller' => 'Home',
));
Route::set('auth', 'user/<action>', array('action' => 'login|logout'))
->defaults(array(
'controller' => 'User',
));
Route::set('user/profile/edit', 'user/profile/edit(/<user>)')
->defaults(array(
'controller' => 'User_Profile', // Controller_User_Profile
'action' => 'edit',
));
Route::set('user/profile/view', 'user/profile(/<action>(/<user>))', array('action' => 'edit'))
->defaults(array(
'controller' => 'User_Profile',
));
############
class Controller_User_Profile {
public function action_index()
{
// ...
$this->action_view($user->username());
}
public function action_view($user = NULL)
{
if ($user === NULL)
{
$user = $this->request->param('user');
}
// ...
}
}
Personally I like to send my users to a dashboard, which can be(come) different from viewing your own profile.
This is just A way of doing it.