Comments (8)
I've had a long deliberation blocker here - whether to go with Devise or start from scratch. I now think going from scratch to have an event sourced Authentication module is the way to go. However with this ticket I imagine to go with something super simplest. Maybe just have commands for setting the accounts (login/password) for clients (without the registration UI yet), use them in the seeds. Then some UI (login/password) only for the customer panel.
from ecommerce.
Hi, @andrzejkrzywda
As I have mentioned, I would love to help out with this one.
I've seen the work around Client
idea in 0af1cae and f962d0b
Do you see Client
entity/commands/events as a part of Ordering
context or should it rather get its own one?
Or perhaps the Client
referred in this issue should in fact be a Customer
and that's Customer who should be given a login/password?
I would love to align this before I ship my idea of the solution
from ecommerce.
I think we can start with a new BC called Authentication (similarly as in the red book - the Identity and Access BC).
The Account
seems like a good building block here.
For the start we probably need:
- RegisterAccount(id)
- SetLogin(account_id, login)
- SetPasswordHash(account_id, password_hash)
- ConnectAccountToClient(account_id, client_id)
The consequence would be that we allow multiple accounts per client, which is fine by me.
Those commands would then be used in the seeds to set up the existing clients. We will create UI for creating accounts as a separate ticket.
For the login process we probably need something like LoginSession
.
- StartSession(uid, credentials)
Let's make the Logout feature as a separate ticket.
BTW, currently we use client/customer as synonyms.
How does it sound?
from ecommerce.
Sounds great!
Thank you very much for the detailed description. I will jump into it next week and hopefully deliver shortly after.
from ecommerce.
There was a bit of progress about it recently. Instead of using URL, we now store cookies.
some context: https://dev.to/andrzejkrzywda/implementing-authentication-in-tiny-steps-jhn
@pstrzalk how is it going? need any help?
from ecommerce.
Thank you very much for the head's up @andrzejkrzywda
Actually, I need 48h days too keep up with all the plans and promisses... I'm terribly sorry to keep you waiting for so long.
Back when I started, I've added the new BC and the first events. But I had to put it on a shelf for much longer than I expected.
I will be back with my mac in 5-6 days. I will make sure that what I had prepared makes sense and push forward
from ecommerce.
I have re-visited my changes and adjusted a bit. I've created a WIP PR at #175
So far I've
- added Authentication BC
- added commands & events
- RegisterAccount
- SetLogin
- SetPasswordHash
- ConnectAccountToClient
- added tests and made sure mutation tests work fine
When you have a chance, please take a look and let me know what you think. Again - sorry for the delay.
The next step, if I understand correctly, is to:
- add
LoginSession
AggregateRoot withstart_session
method - add
StartSession
command &SessionStarted
event - raise error if credentials don't match
- use this all in the
login
action of theClient::ClientsController
The thing I'm not sure about is - what's the intended approach for checking the credentials?
@andrzejkrzywda
from ecommerce.
Added the possibility to login with password.
Extracted tasks:
from ecommerce.
Related Issues (20)
- Decouple Customers read model from ClientOrders in UpdatePaidOrdersSummary HOT 1
- Make ReservationProcess asynchronous
- Consider if invariant in Crm::Order is really needed
- Review Ordering::Order possible state transitions and/or update docs
- Move Omnibus directive related stuff from ClientOrders to PublicOffer read model HOT 2
- Allow users to set password
- create ClientAuthentication read model
- Generating an invoice doesn't work
- Decouple domain modules from sidekiq
- Setting future price to 0 crashes the app
- Reset discount - link doesn't work
- Submitting order crashes sometimes
- After reset discount the page doesn't refresh HOT 1
- After update discount the page doesn't refresh
- Setting discount on empty order crashes HOT 1
- Error raised : Arkency::CommandBus::UnregisteredHandler: Missing handler for Crm::RegisterCustomer HOT 5
- Integration test for adding unavailable item to order (as client)
- Rename Pricing::Order to Pricing::Offer HOT 1
- Consider creating Sales BC which contains Pricing and maybe others HOT 1
- Log out when detecting unexisting client_id in cookies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecommerce.