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

Issue on clean startup (dbempty) and superadminCredentials.identifier with a least one character uppercase #2485

Closed
giosueDelgado opened this issue Oct 24, 2023 · 4 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@giosueDelgado
Copy link
Collaborator

giosueDelgado commented Oct 24, 2023

Describe the bug
When attempting a clean startup with the "dbempty" flag, and having at least one uppercase character in the superadminCredentials.identifier, an issue occurs.

To Reproduce
Steps to reproduce the behavior:

Go to 'the startup configuration file'.
Set the dbempty flag to true.
In the superadminCredentials.identifier, use a string with at least one uppercase character, for example "Admin".
Attempt to start up Vendure.
See error.
Expected behavior
The expected behavior is for Vendure to start up cleanly, regardless of the case of characters in the superadminCredentials.identifier.

Environment (please complete the following information):

@vendure/core version: 2.1.1
Nodejs version: 16.17.0
Database (mysql/postgres etc): postgres

@giosueDelgado giosueDelgado added the type: bug 🐛 Something isn't working label Oct 24, 2023
@giosueDelgado
Copy link
Collaborator Author

FYI @LorenzoRottigni

@michaelbromley
Copy link
Member

Hi,

What's the dbempty flag you refer to? I'm not sure how to reproduce what you have run into but I just tested with this config:

    authOptions: {
        disableAuth: false,
        tokenMethod: ['bearer', 'cookie'] as const,
        requireVerification: true,
        customPermissions: [],
        cookieOptions: {
            secret: 'abc',
        },
        superadminCredentials: {
            identifier: 'Admin',
            password: 'admin',
        },
    },

and repopulated the server from scratch and was then able to login with the provided superadmin credentials.

@giosueDelgado
Copy link
Collaborator Author

Sorry I be more clear: there isn't a emptydb flag but is to setup an empty database.
Using the version 2.1.1 we were unable to start the database using the string admVendure because the logic was creating the user admvendure (lowercase) so it continue to create user and not find that was existing because not exist in the database with an uppercase..

@michaelbromley
Copy link
Member

Thanks for the clarification. Investigation revealed several points that needed fixing in order to support case-sensitive identifiers. This will be fixed in the next patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants