I've created a really basic extension to bypass the default message. It redirects to an account page on login and the home page on logout but this could be modified to point to any URL (i.e. a custom message landing page)
I've included a link to the download but should that expire you'll need to copy/save these two files into system/user/addons/loginbypass/
ext.loginbypass.php
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Loginbypass_ext
{
var $name = 'Login Bypass';
var $version = '1.0.0';
var $description = 'Bypasses default ExpressionEngine login/logout messages';
public function activate_extension()
{
/**
* As far as I understand, these two hooks take place after authentication
* so you don't need to worry about any of that
**/
$this->add_hook('member_member_login_single');
$this->add_hook('member_member_logout');
}
public function disable_extension()
{
ee()->db->where('class', __CLASS__);
ee()->db->delete('extensions');
}
public function update_extension($current = '')
{
if ($current == '' || (version_compare($current, $this->version) === 0))
{
return false;
}
}
public function member_member_login_single()
{
ee()->load->helper('url');
// Change $url to wherever you need to redirect on login
$url = site_url() . 'account';
// Side note: this should be site_url('account') but it isn't working for my install
redirect($url);
return FALSE;
}
public function member_member_logout()
{
ee()->load->helper('url');
// Change $url to wherever you need to redirect on logout
$url = site_url();
redirect($url);
return FALSE;
}
private function add_hook($name, $priority = 10)
{
ee()->db->insert('extensions',
array(
'class' => __CLASS__,
'method' => $name,
'hook' => $name,
'settings' => '',
'priority' => $priority,
'version' => $this->version,
'enabled' => 'y'
)
);
}
}
addon.setup.php
<?php
return array(
'author' => 'Kieran McClung',
'author_url' => 'https://github.com/kieranmcclung',
'docs_url' => 'https://github.com/kieranmcclung/ee-loginbypass',
'name' => 'Login Bypass',
'description' => 'Bypasses default ExpressionEngine login/logout messages',
'version' => '1.0.0',
'namespace' => 'Loginbypass',
'settings_exist' => FALSE
);
Download link for extension