Giter Club home page Giter Club logo

Comments (11)

jgudo avatar jgudo commented on May 24, 2024 1

Looks like you're passing undefined data in selectFilter(). Have you added the products in the database using the admin user? You must uncomment all the admin-related stuffs inside src/routers/AppRouter.js and lastly, inside src/reducers/authReducer.js, just change the type property of initState from 'client' into 'admin' to use the admin mode. Then only you can perform CRUD operations.

from ecommerce-react.

6samuel avatar 6samuel commented on May 24, 2024 1

I Figured it out by myself there was a small error. I had to initialize the admin type separately. the initState did not work for the admin type.

I Recommend we should use firebase rules with custom claims. that way you don't have to worry about the dashboard section. any way thanks

from ecommerce-react.

6samuel avatar 6samuel commented on May 24, 2024

Looks like you're passing undefined data in selectFilter(). Have you added the products in the database using the admin user? You must uncomment all the admin-related stuffs inside src/routers/AppRouter.js and lastly, inside src/reducers/authReducer.js, just change the type property of initState from 'client' into 'admin' to use the admin mode. Then only you can perform CRUD operations.

I did as you asked but how to login to admin pannel.

from ecommerce-react.

6samuel avatar 6samuel commented on May 24, 2024

Looks like you're passing undefined data in selectFilter(). Have you added the products in the database using the admin user? You must uncomment all the admin-related stuffs inside src/routers/AppRouter.js and lastly, inside src/reducers/authReducer.js, just change the type property of initState from 'client' into 'admin' to use the admin mode. Then only you can perform CRUD operations.

I tried to login using the available signin method but it is not redirecting to admin dashboard. Am i missing anything.

from ecommerce-react.

jgudo avatar jgudo commented on May 24, 2024

The default user auth could've been persisting. Log out the default user or you can delete the auth details of user in localStorage. Then you must be able to get to the /dashboard page

from ecommerce-react.

jgudo avatar jgudo commented on May 24, 2024

The admin doesn't have the available login methods unlike the client does. That's the problem that I have with the admin authentication.

from ecommerce-react.

6samuel avatar 6samuel commented on May 24, 2024

The default user auth could've been persisting. Log out the default user or you can delete the auth details of user in localStorage. Then you must be able to get to the /dashboard page

I did everything man still the dashboard is not opening. Is there any other things i need to keep in mind.
see i have a work around for this error but i need to get to the admin dashboard to fix it.

from ecommerce-react.

jgudo avatar jgudo commented on May 24, 2024

Are you getting any error or it just don't redirect you to the admin?

from ecommerce-react.

jgudo avatar jgudo commented on May 24, 2024

Have you done all this?

  1. Uncomment all admin-stuffs inside src/routers/AppRouter.js
  2. Inside src/reducer/authReducer.js, if you don't want a test user, delete or comment out the initState variable and set the state to an empty object {} If you want to use admin, you must change type property to 'admin' to use admin mode.
  3. Delete the auth data in localStorage if it exists (i think the key name is 'root')

from ecommerce-react.

6samuel avatar 6samuel commented on May 24, 2024

Are you getting any error or it just don't redirect you to the admin?

After Clearing the localstorage i am being redirected to dashboard but for few second only. then again it is going back to the homepage

from ecommerce-react.

jgudo avatar jgudo commented on May 24, 2024

Great! It would be awesome if you could make a pull request for these necessary changes. 👌

from ecommerce-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.