question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Make authentification guide simpler

See original GitHub issue

Hi, guys!

First of all, great project idea šŸ‘ŒIā€™ve tried to come up with a valid idea on a usable data synchronization engine between backend and client, and all I got was sending data with timestamps back and forth, not so convenient. Glad someone wants to make this whole mess working once and for all.

Stumbled upon Andreyā€™s request to try and launch logux following your starting guide and drop a line on problems one may encounter.

Iā€™ve tried to carefully follow every step, but some results doesnā€™t match those in the doc.

reducers/index.js

If you implement it like it is in the doc, nothing will work on this step, because of an error:

Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.

Iā€™ve changed the implementation to a simple counter reducer and this error was gone. Example purpose only, of course.

const reducer = (state = 0, action) => {
  if(action.type === 'inc') return state + action.payload
  else if(action.type === 'dec') return state - action.payload
  else return state
}
export default reducer

Logux server sent error: Wrong credentials

Also doesnā€™t seem to work, I donā€™t even have anything in WS tab except the one with hot code reload stuff. I had a thought, that I may be watching the wrong place, but Iā€™ve even tried to throw an error in server.auth method, but nothing happens at all; however if I open the healthcheck url everything seems to be fine. Can you please tell me what Iā€™m doing wrong?

My opinions

The rest is only my opinion on the document itself, so you can ignore if you want šŸ˜„

  1. I think this guide should separate authorization implementation details and logux server stuff. I would even offer you to change authentication chapter to something like ā€œPretend we only have a user with email test@example.com and password 123456ā€. It would make the demo 10 times simpler. It would also mean that you can drop the DB stuff out of tutorial and, say, use node module variables as storage just for the sake of simplicity. Does it really matter how I retrieve data when all I want is to have a grasp on how the library works?
  2. Iā€™m not sure about it, but seems to me on current stage of the project every single document anyone reads should sell the project idea, jump to the fancy stuff and avoid all the unnecessary instructions. From what I saw the tutorial was mostly a demonstration of different stuff loosely related to the topic. It would be awesome to have something like the README.md demonstration, but the one you can touch, run and see how it works in the wild with all the fancy stuff that you talk about (like conflict resolution, offline-first work and multi-tab/multi-device).

Anyway, good luck with the project. Will follow you and try to use in future šŸ‘

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Jul 8, 2019

As I saw it you were trying to solve the data synchronization problem for developers with prior experience who already know that this is a real pain in the ass.

It is more complicated.

  1. First, we may see non-Node.js developers who need help with finding database best practices for Node.js.
  2. Second, we also trying to achieve middle developers, who need to add WebSocket to their redux project

I see there may be all the info out there in 1-architecture folder.

Yeap, this part is much better in showing Logux benefits.

1reaction
aicommented, Jul 6, 2019

Thank for suggestions.

Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.

Fixed 66e8b7f

Logux server sent error: Wrong credentials

At what step did you find this error?

If it was still on 3-creating-redux.md, how we can make this warning more clear and understandable?

I think this guide should separate authorization implementation details and logux server stuff

I am afraid of repeating MongoDB problem. They have very simple auth process by default. And now most of MongoDB databases are not protected at all.

Maybe we can add some logux/auth library to simplify examples, but I want to finish docs first and then move to create helpers (and updating docs using these helpers).

It would also mean that you can drop the DB stuff out of the tutorial and, say, use node module variables as storage just for the sake of simplicity.

I want to be more on Ruby on Rails way with everything is ready after initializing, rather than Node.js way when junior developers donā€™t know how to do basic things like adding DB correctly.

It would be awesome to have something like the README.md demonstration, but the one you can touch, run and see how it works in the wild with all the fancy stuff that you talk about

Yeap. Docs are just in the beginning.

I will create an example and more docs about Logux internals and best practices.

Right now we have selling 1-architecture part and very production oriented 2-starting.

You are right that 2-starting are created very close to the real production code. But it was made by a purpose. I want to give a strict instruction on how to create a real project, not fancy but dangerous demo.

However, I agree that we should be even more on Ruby on Rails way and provide good production ready server with fewer steps. I will do it after I will finish the first version of the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beginners Guide to Authentication Basics - Level Up Coding
In my university days, I struggled for months finding an optimal way to create a full-stack Authentication and authorization system using MERNĀ ...
Read more >
Simple Authentication Guide Create Authentication in Rails
We are going to create simple authentication in Rails. We want our users to add privilege to access certain web pages.
Read more >
User Authentication: Understanding the Basics & Top Tips
The process is fairly simple; users input their credentials on the website's login form. That information is then sent to the authentication ......
Read more >
Guide to Web Authentication
An introduction to Web Authentication (WebAuthn), the new API that can replace passwords with strong authentication.
Read more >
Use these 6 user authentication types to secure networks
Users may be familiar with biometrics, making it easier to deploy in an enterprise setting. Many consumer devices feature biometric authentication ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found