chef / supermarket

Chef's community platform
https://supermarket.chef.io/
Apache License 2.0
214 stars 113 forks source link

Improve error message when unable to create accounts #1298

Open nellshamrell opened 8 years ago

nellshamrell commented 8 years ago

Issue Summary: Clicking create account when in LDAP leads to a broken page Request for Development: Product Fix Blocking Issue: Support identified how to fix the issue by hacking a live file.

We use LDAP authentication for our supermarket. When a user visits the site they are presented with 'Sign In' and 'Create Account'. Some users intuitively go to 'Create Account'., When in an LDAP environment the following error is then shown:

" The page you were looking for does not exist.

You may have mistyped the address or the page may have moved. "

A sensible message should be shown directing users to sign in as it's an LDAP environment or the 'Create account' option should not be shown when using LDAP

robbkidd commented 8 years ago

Currently, Supermarket has no knowledge of how its affiliated Chef Server is authenticating users. I'd recommend researching option A "sensible message should be shown directing users to sign in as it's an LDAP environment" at the Chef Server side when Chef Server receives a request to /signup and LDAP is enabled. (Or just redirect /signup to the Chef Server's sign in—/auth/chef_oauth2?—endpoint.)

Option B—don't display Create Account link—may get trickier with Supermarket and Chef Server having to coordinate the knowledge that account creation is disabled because an external authn provider exists.

robbkidd commented 8 years ago

Option B is also basically the requested feature #1231 .

nathenharvey commented 7 years ago

Can the signup URL not be overridden by setting $CHEF_SIGN_UP_URL in the Supermarket's environment? We may be able to resolve this issue with a simple documentation fix.

  def chef_sign_up_url
    ENV['CHEF_SIGN_UP_URL'] || "#{chef_manage_url}/signup?ref=community"
  end

https://github.com/chef/supermarket/blob/master/src/supermarket/app/helpers/custom_url_helper.rb#L52-L54