Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Login is not working when I scaffold a Catalyst application #1037

Open
Pedro-Silva-MM opened this issue Jun 26, 2024 · 12 comments
Open

Comments

@Pedro-Silva-MM
Copy link

Describe the bug

When starting a new Catalyst project connected to my BigCommerce store, the customer login functionality does not work. This issue occurs after following the instructions to create a new channel for the Catalyst project. The login attempt returns an error indicating that “Operation cannot be performed as the storefront channel is not live,” even though the channel shows up as active in the BigCommerce admin panel.

To Reproduce

Steps to reproduce the behavior:

1.	Run the command pnpm create @bigcommerce/catalyst@latest
2.	Follow the prompts:
•	Name your project: <project-name>
•	Connect to a BigCommerce store: Yes
•	Authorize the device code at https://login.bigcommerce.com/device/connect
•	Create a new channel: Yes
•	Name the new channel: <channel_name>
3.	Navigate to the project directory: cd <project_name>
4.	Start the development server: pnpm run dev
5.     Register a customer on http://localhost:3000/login/register-customer/
6.	Attempt to log in using the login function in http://localhost:3000/login/

Expected behavior

The customer should be able to log in successfully.

Screenshots

image

I've added a log to when the login happens and here is the response.

image

The storefront channel shows up as active on https://.mybigcommerce.com/manage/channel-manager

@chanceaclark
Copy link
Contributor

Hey @Pedro-Silva-MM, did you just change your BigCommerce storefront from prelaunch to active status? If so, it does take a little time to propagate.

@Pedro-Silva-MM
Copy link
Author

Hey, thanks for the quick response.

I assume that you are referring to the storefront channel, if so I didn't. As far as I can tell the channel is created during the CLI setup. I've been trying to figure out whats wrong for some hours, I'm not sure if a propagation issue would take that long.

I don't know if it matters but I'm on BigCommerce free trial.

@chanceaclark
Copy link
Contributor

Can you provide the full url to your store? https://store-{{storeHash}}.mybigcommerce.com/

@Pedro-Silva-MM
Copy link
Author

@Pedro-Silva-MM
Copy link
Author

Just reproduced the same issue with a fresh account.

@chanceaclark
Copy link
Contributor

chanceaclark commented Jun 27, 2024

https://store-amf0e6ddtt.mybigcommerce.com

Try again on this storefront again. I turned your Catalyst channel to active and set the BigCommerce storefront to inactive. That's how it should be setup for Catalyst + Redirected Checkout.

If it's still happening, can you provide of the following information:

  1. The channel id used in your .env.local file.
  2. The version of next you are using (or screenshot the output of pnpm why next)

@Pedro-Silva-MM
Copy link
Author

Hey, here is what I did:

  1. Created a fresh catalyst application again with pnpm create @bigcommerce/catalyst@latest
  2. During the CLI setup I chose to connect with my BigCommerce store, and to my catalyst channel
  3. Finished the setup and ran pnpm run dev
  4. Only thing that shows up on localhost:3000 is a maintenance page
image 5. Tried creating another catalyst project but connecting to a different channel, activated the channel on the BigCommerce admin UI and got the same result on localhost:3000

Here is the channel Id used on my .env.local on my first attempt: 1598252
Here is the channel Id I used during the second : 1

Here is the output of pnpm why next :

image

@chanceaclark
Copy link
Contributor

Hey @Pedro-Silva-MM, I seem to have figured out this issue. Essentially our API is reading the storefront status from the default channel (1) if you don't have a specific feature flag enabled for your store. It shouldn't matter if you have the FF enabled or not, when trying to read the status from another channel – in your case 1598252. I am passing this along to the team that handles that API interaction to try and get it resolved.

In the meantime, I do believe there is a "fix", that's not ideal. Go into Channel Manager in the Control Panel and change the default channel 1 to be active. You might have to make the other channel inactive in order to active the default channel as we have storefront limits in place. Let us know if that doesn't work.

@Pedro-Silva-MM
Copy link
Author

Hey @chanceaclark, thanks for the support.

The fix you provided worked, thank you.

@chanceaclark
Copy link
Contributor

Awesome glad it worked.

Keeping this issue open till we resolve it on the BC side.

@Pedro-Silva-MM
Copy link
Author

Hey @chanceaclark , any update on this?
I believe the solution is causing an issue with the reset password functionality. The reset password email creates the reset password URL with the default store url

image

@chanceaclark
Copy link
Contributor

@Pedro-Silva-MM the team is still looking into as it's not a quick fix for us.

Regarding that email link, you'll need to configure your Site Routes in order for that to update I believe: https://developer.bigcommerce.com/docs/rest-management/sites#site-routes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants