What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello guys, we need to make one change in the authentication method, actually spryker uses the emai

U01UP8B567L
U01UP8B567L Posts: 3 🧑🏻‍🚀 - Cadet

Hello guys,

we need to make one change in the authentication method, actually spryker uses the email as username, but we need to change it for the phone number (phone).

We have two options for this change:

1.- overwrite the code of the classes, adding the phone as principal field of authentication,

2.- create a new module of spryker bassed on the existent functionality.

we need to know if its factible or if we goint to have problems with dependencies of this module? or can you help us making a suggestion about this.

currently exists this functionality? if so, they could tell us if we have to install any extra module or give us suggestions to implement it.

Comments

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    Hi Daniel,
    the both options you’ve mentioned are relevant and it’s always a dilemma which way to go 🙂 Roughly, I would define it as following:
    Create a new module when:
    • Existing functionality (extension candidate) doesn’t really fit the purpose of your change - so you would have to overwrite a lot instead of re-use (also in the future perspective)
    • Candidate for extension solves another problem conceptionally - you would have to misuse/overwrite the existing feature. (also in the future perspective)
    Extend the existing functionality when:
    • Most of the code fits your needs, you’re just missing a bit of a functionality (you’re going to re-use a lot)
    • Fixing found core bugs or issues that prevent you to add your new functionality
    • Extension is convenient to add and it will be encapsulated well enough and won’t heart future upgradeability

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    edited June 2021

    I would categorise your issue - use phone instead of username - as rather an extension of the existing functionality. Add some missing methods to the client, e.g. “findUserByPhone” and use it instead of “findUserByEmail” - and provide necessary queries to make that happen