Change the submit function for user login I'm building a site for a client that already has a website through another CMS that they do not wish to move away from despite my best efforts to convince them otherwise.

This CMS does offer an api that allows for implementation for single sign on so I'm trying to set that up.

I've gotten as far as 

    function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id)
    {
        if ($form_id == 'user_login') {
            $form['#submit'] = ['mymodule_login'];
        }
    }

    function mymodule_login($form, &amp;$form_state)
    {
        exit('SUCCESS');
    }


But the success message is never shown. 

Oh, I tried searching to see if there was already a module that implemented this but no such luck.
Is you module named mymodule? The prefix of the hooks has to be the same as the machine readable name of your module. After checking that, try clearing the cache. After that, is should work because the code looks all right.