# Simple plugin to create landing page for SSO not working anymore

**URL:** https://meta.discourse.org/t/simple-plugin-to-create-landing-page-for-sso-not-working-anymore/228610
**Category:** Development
**Created:** [May 31, 2022, 3:00pm UTC](https://meta.discourse.org/t/simple-plugin-to-create-landing-page-for-sso-not-working-anymore/228610 "2022-05-31T15:00:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [May 31, 2022, 3:00pm UTC](https://meta.discourse.org/t/simple-plugin-to-create-landing-page-for-sso-not-working-anymore/228610/1 "2022-05-31T15:00:07Z")

</div>

Continuing the discussion from [Landing page on saml login](https://meta.discourse.org/t/landing-page-on-saml-login/149377/14):

> [@Landing page on saml login](https://meta.discourse.org/t/landing-page-on-saml-login/149377/14):
>
> You could override this in a plugin by patching this method:
> 
> [https://github.com/discourse/discourse/blob/master/app/controllers/application\_controller.rb#L697-L714](https://github.com/discourse/discourse/blob/master/app/controllers/application_controller.rb#L697-L714)
> 
> So I think you would want to simplify the function right down to
> 
> ```plaintext
> def redirect_to_login
> dont_cache_page
> cookies[:destination_url] = destination_url
> redirect_to path("/login")
> end
> 
> ```

I’m not sure if this should be in #Support or #Development or something else, so feel free to move it as you deem necessary.

I created a plugin in March 2022 to override the function above and it seemed to work for a while and then now noticed that it isn’t working (I don’t know for how long).

Does anyone have an idea why it may have stopped?

(note, the enable setting never worked, so if anyone knows why that also doesn’t work, I’d be grateful)

```ruby
enabled_site_setting :no_auto_login_enabled

after_initialize do
 	if SiteSetting.no_auto_login_enabled	
		class ::ApplicationController
		  module NoAutoLoginRedirectToLogin
			def redirect_to_login
				dont_cache_page
				cookies[:destination_url] = destination_url
				redirect_to path("/login")
			end
		  end	
		  prepend NoAutoLoginRedirectToLogin
		end
	end
end

```
