<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dan Lages on Medium]]></title>
        <description><![CDATA[Stories by Dan Lages on Medium]]></description>
        <link>https://medium.com/@daniel.lages?source=rss-4d16e02a93fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZQlsnfNJ4ZK0jzJ15omhkg.png</url>
            <title>Stories by Dan Lages on Medium</title>
            <link>https://medium.com/@daniel.lages?source=rss-4d16e02a93fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:42:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daniel.lages/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Refined Authentication Experience]]></title>
            <link>https://medium.com/justeattakeaway-tech/a-refined-authentication-experience-ed39f43d02c6?source=rss-4d16e02a93fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed39f43d02c6</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Dan Lages]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 16:38:00 GMT</pubDate>
            <atom:updated>2026-01-06T16:57:22.841Z</atom:updated>
            <content:encoded><![CDATA[<p>In a large-scale consumer application, it is vital that the authentication experience is both secure and intuitive. The Just Eat Takeaway application has taken significant strides in consolidating and improving its authentication experience. As we enter the new year, and ahead of more developments, let’s take a look at the journey so far.</p><h3>A new app</h3><p>One of the most significant changes to the Just Eat Takeaway app offering is the migration to a single application. As we migrated users from a legacy application to the new offering, we needed a way to migrate users as they launched the update for the first time, ensuring they remained logged in. Implemented as a background operation, this was a significant achievement and served as the basis for future authentication improvements.</p><h3>A platform</h3><p>Security is only as strong as its weakest point. Many of the significant changes in and around authentication have focused on the removal of passwords (see passkeys, for example). We have done the same. Prone to error and cumbersome, passwords are a security risk. With the new passwordless login screen, the application now leverages Multi-Factor Authentication. This reduces the risk of brute-force and credential-stuffing attacks and also improves the user experience. In a few seamless steps, a code is emailed to the user and, when submitted, the user is logged in.</p><p>Behind the scenes, the application also leverages security features such as <br><a href="https://developer.apple.com/documentation/devicecheck">Apple’s DeviceCheck</a>, ensuring device legitimacy with a device token that is checked against the API service. The result of these developments is a streamlined experience that improves both security and usability for our users while serving as a baseline for optimisations going forward. If you would like more insight, I have written <a href="https://danlages.com/authentication/2026/01/03/implementing-secure-login.html">here</a> about the development journey of this flow and how it was achieved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQBDkI-NQo-6tAj4Tcl0lw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*tPiKC-v7oDAWA36-NZOgvA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*FNqqIqUfyqqDjf8pjjSKLQ.jpeg" /><figcaption>The progression of the login and create account experience</figcaption></figure><h3>Optimising the Authentication Domain</h3><p>In a modular architecture, you’ll often have an engineering team responsible for one or more modules. My domain, authentication, has prominent responsibility within the iOS consumer application: the creation and management of user information and authentication sessions.</p><h4>Streamlined</h4><p>Behind the scenes, the passwordless login experience also paved the way for a modern architecture. The complete account flow, written fully in SwiftUI, allows users to create an account as part of the same passwordless experience. Recognising that the email is not registered, the flow will prompt the user to complete their account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*8YSvkVQhkvjpIEZXCzAT8A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*YkL43lW93E93Mt7ZH42xmw.jpeg" /><figcaption>Pictured is the legacy create account flow (left) and the new complete account flow (right), which is an extension of the passwordless screen.</figcaption></figure><p>The completion of this user journey facilitated the removal of all password flows. No longer do users need to set a new password. The guest checkout experience was also removed. Together with account deletion (also rewritten in SwiftUI), the result is a domain that is concentrated on a few delightful experiences that are modern in architecture and serve as a robust baseline for iteration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*nXfO1WrRztfMBklspCNBkA.jpeg" /><figcaption>Pictured is the SwiftUI based Account deletion screen.</figcaption></figure><p>The result of these changes is a domain that is mainly written in SwiftUI, lightweight, and modularised. This was a targeted effort, intentionally moving the codebase to a modern architecture and away from UIKit.</p><h4>A global domain</h4><p>Much of the consolidation effort has been about adopting global endpoints. This enabled a large refactoring of the business logic. No longer are we calling different endpoints depending on where the user is situated. This immediately reduced the complexity required within the iOS application. This development, enabled by the backend team, highlights an important lesson. As an iOS engineer, it is important to collaborate across domains to achieve goals, whether it is endpoint design, testing, or implementation. The adoption of global services benefits both the backend teams, as they look to consolidate their codebases, and the client.</p><h3>Getting here</h3><h4>Recognising when to push</h4><p>As an engineer in charge of a domain, you’ll often want to make improvements. Recognise what initiatives are coming up and whether your time is best spent on optimisation now or if it can be handled as part of a new piece of work. Recognising this allows you to plan your roadmap and communicate when a given change will be delivered to any stakeholders. This will be important as you prioritise your work and push back against changes that may hinder higher-priority initiatives.</p><p>This was particularly pertinent for the migration of endpoints to async/await syntax. Understanding that we would soon be adopting new endpoints allowed for the reprioritisation of async/await and, instead, a focus on the SwiftUI implementation of login.</p><h4>Iterate fast</h4><p>You will often get bursts of inspiration when tackling a domain; lean into this. Many paradigms within iOS engineering are lightweight and fairly easy to implement. So, if you find, like me, that you have inherited a largely UIKit-based codebase, rewrite it. Do it when it makes sense and focus on the right priorities, but there is often no better time to start the work. The current implementation is usually a great guide for what to do.</p><h3>Summary</h3><p>This has been a period of great progress for the Just Eat Takeaway authentication domain. This is the product of not only my work, but also the work of various product owners and engineers over time. The iOS module is refined, robust, and able to deliver a seamless authentication experience. More to come.</p><p>Want to work with us at <strong>JustEat Takeaway.com</strong>? <a href="https://bit.ly/TechBlogFooter">Check out our open roles</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed39f43d02c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/justeattakeaway-tech/a-refined-authentication-experience-ed39f43d02c6">A Refined Authentication Experience</a> was originally published in <a href="https://medium.com/justeattakeaway-tech">Just Eat Takeaway-tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing an intuitive and secure login method within an agile engineering environment]]></title>
            <link>https://medium.com/justeattakeaway-tech/implementing-an-intuitive-and-secure-login-method-within-an-agile-engineering-environment-7eb768e35ae5?source=rss-4d16e02a93fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7eb768e35ae5</guid>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <category><![CDATA[ios-development]]></category>
            <dc:creator><![CDATA[Dan Lages]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 15:20:12 GMT</pubDate>
            <atom:updated>2025-07-21T15:53:27.044Z</atom:updated>
            <content:encoded><![CDATA[<p>As with any platform, login is a crucial part of the user journey, allowing them to enjoy a more personalized ordering experience. Optimising this flow such that it is more secure and easy to use is a key undertaking and one that has been achieved with the rollout of the Passwordless Authentication feature.</p><p>With the new flow, we are removing the need to login with passwords, leveraging email verification. We will require a user to use a one time password in order to complete their login journey. This article will explain the processes adopted for the implementation of this feature in an agile development environment, with insights into how to work within a team to deliver a new feature of this scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*iyv8-19BOd27JH2K5zE6kg.jpeg" /><figcaption>The new JustEatTakeaway login screen</figcaption></figure><h3>Plan</h3><p>At a high level, this appears obvious but there are a lot of elements that go into the planning phase in a team that has many stakeholders and components.</p><p>In a full stack team, you may be collectively responsible for a range of components across different clients. For example, in this case, we mirrored the implementation of the passwordless flow on iOS and Android platforms. As such, aligning on these in the planning phase will speed up implementation.</p><p>During the initial phase, we need to identify which work items can be reused or mirrored for different clients. This approach promotes better alignment, allows for shared implementation details, and establishes consistent naming conventions in the code, all of which will streamline future communication.</p><h3>Communication with Stakeholders</h3><p>The key to delivering any project is aligning with key stakeholders on progress. Typically, in mature engineering teams, this is often achieved through agile ceremonies. However, involving them in the planning process allows for more evidenced reasoning behind timescales.</p><p>Through writing and estimating tickets, you can use the data to provide clear estimates based on prior velocity and current complexity of work. This will allow the stakeholders (whether a product manager or another engineer) to communicate upwards with a clear picture of the work involved. As discussed earlier, aligning with clients will allow you to represent this work with clarity.</p><h3>Adopting a leadership role as an engineer on a project</h3><p>As someone assuming a leadership position in the team you may be in a position of leadership in regards to the engineering effort. This often entails collaborating and steering other engineers to reach the common goal.</p><h3>Assessing the level of involvement</h3><p>In teams in which work items are ticketed. consider writing tickets that describe, with good detail as to the work that needs to be actioned. This could include prescriptive steps, or simple guidance.</p><p>The best attribute in this situation is adaptability. Assess what the engineers in the team need and outline work or collaborate with the right level of abstraction. The focus should be fostering an environment for growth on these projects and learning in a collaborative space, even when things don’t go to plan.</p><h3>Encouraging growth</h3><p>Often there may be a tendency to complete tickets quickly as an engineer with domain knowledge. If the situation allows, focus on sharing that knowledge. Actioning items in collaboration allows engineers to be exposed to new processes or tasks that they may perceive as requiring experience.</p><p>Set up meetings to discuss the design and implementation, leading where required but enabling others to do so.</p><p>Often this role requires pragmatism, the judgement to determine if the time spent on a certain implementation detail is optimal when compared with the wider missions statement. Making these decisions and communicating them is key.</p><p>These behaviours have a full circle effect and allows for growth ahead of the next project.</p><p>Want to come work with us at Just Eat Takeaway.com? <a href="https://bit.ly/TechBlogFooter">Check out our open roles</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7eb768e35ae5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/justeattakeaway-tech/implementing-an-intuitive-and-secure-login-method-within-an-agile-engineering-environment-7eb768e35ae5">Implementing an intuitive and secure login method within an agile engineering environment</a> was originally published in <a href="https://medium.com/justeattakeaway-tech">Just Eat Takeaway-tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Frictionless Authentication Flow]]></title>
            <link>https://medium.com/justeattakeaway-tech/building-a-frictionless-authentication-flow-a66ace912f1f?source=rss-4d16e02a93fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a66ace912f1f</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[multifactorauthentication]]></category>
            <dc:creator><![CDATA[Dan Lages]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 15:49:40 GMT</pubDate>
            <atom:updated>2023-06-15T16:13:37.983Z</atom:updated>
            <content:encoded><![CDATA[<p>Account Takeover (ATO) is a reality that all platforms and their users must reckon with. It describes a scenario in which a bad actor will gain unauthorised access to a user’s account. This, of course, has negative consequences for the victim of such an attack, allowing the perpetrator to order goods or even sell personal information.</p><p>There are many steps a user can take to help mitigate such risks against their account, such as avoiding the re-use of passwords. However, through implementing a set of secure features on the Just Eat Takeaway platform, we can protect our users against this challenge.</p><p>One of these features is Multi-Factor Authentication (MFA), which provides an extra authentication step, protecting our customers and adding another layer of security for their accounts. Although not a new concept, we have worked hard to implement a flow that does not introduce friction. Here, we’ll be talking through how this new MFA flow was implemented in the iOS application, creating a secure but intuitive user experience.</p><p>At the heart of this feature is a new screen that prompts the user to enter a single-use code in order to complete their login journey.</p><ol><li>Enter your email address and password</li><li>Get prompted to check your email</li><li>Enter the access code into the challenge screen</li><li>Place your order!</li></ol><figure><img alt="Images showcasing the MFA flow on the iOS application." src="https://cdn-images-1.medium.com/max/742/1*pUxe0Db7edEMZczzNAwv1Q.png" /></figure><h3>Challenging only when required</h3><p>Despite its clear benefits, implementing multi-factor authentication adds an extra hurdle for the user. With this in mind, our services adopt a machine learning tool that evaluates the risk factor associated with an account and will inform on whether to challenge a user, triggering multi-factor authentication only when required.</p><p>This reduces friction immediately for those that don’t require an MFA challenge. For those that do, we have implemented a smooth flow to combat the extra step.</p><figure><img alt="A flow diagram demonstrating the MFA flow. If the user is challenged by the ATO service, the user will be sent an email with a one time access code and a new screen in which to enter it. If not the user is not challenged, the user is authenticated straight away." src="https://cdn-images-1.medium.com/max/561/1*W60xlh2KZkiALnx-KJBlpg.png" /></figure><h3>A design that limits friction</h3><p>The key factor in this flow is adding the minimum number of steps required to protect the user. The challenge is doing so in a clear and descriptive way. Therefore, the Multi-factor authentication flow consists of two screens.</p><ul><li><strong>The Code Entry Screen</strong>: Here, the user can see a brief description and enter the one-time access code.</li><li><strong>The Help Screen</strong>: Many users may have further questions on the flow Here we provide a more detailed summary of the reasons for MFA and guidance on troubleshooting.</li></ul><p>The help screen may not be needed by most of the users who encounter the MFA flow. This is by design. Many users who encounter the MFA flow will be familiar with the process from other apps. By moving the further details into an easily accessible separate screen, we make it easier to quickly complete the flow but offer guidance at just a tap away. This was a carefully considered aspect of the design process across all platforms.</p><p>For those that need it, the help screen provides key information on how to grab their one-time access code and proceed. We are conscious that the notion of navigating to a separate email application may not be intuitive. As such, we have introduced a number of helpful points. For example, we highlight that the email may be sent to the spam folder, or take a few minutes to arrive. These are key points that all aid in helping the user through this process.</p><h4><strong>Embedded links</strong></h4><p>The help screen also provides a link to the FAQ page, which offers further information on the flow. Besides adopting <a href="https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller">SFSafariViewController</a> here, keeping the user in the app as to not disrupt the flow, we also use an embedded link.</p><p>To do so within the iOS application, a new class was implemented, allowing us to implement and manipulate bullet point lists. At the heart of this class was a simple ‘for each’ loop, taking in an array of text to be replaced with links.</p><pre>let formattatedString: String // The value of this string is the bullet point list<br>let links:  [String] // The text within the main string to be formatted into links<br><br>links.forEach { linkText in<br>  if let rangeLinkText = formattedString.range(of: linkText),<br>    let url = URL(string: linkText) {<br>    let nsLinkText = NSRange(rangeLinkText, in: formattatedString)<br>  <br>    formattedString.link(url: url, range: nsLinkText)<br>    // Attribute style to the links here<br>}</pre><p>The .link method consists of the following:</p><pre>links.append(.init(style: url, range: range))</pre><p>Another function within the class serves to set all linked text as interactable elements using the <a href="https://developer.apple.com/documentation/uikit/uitextviewdelegate/1649337-textview">textView(_:shouldInteractWith) instance method.</a></p><p>This code requires the link and associated text to be parsed in order. As such, the class accepts these as initialization properties. This implementation allows the links to be modified and added too with a simple code change. If more links were required in the future, we could easily add to the respective arrays. Furthermore, the abstract nature of the class allows it to be used throughout the application.</p><h3>Guiding user interaction</h3><p>The key interactable element of the screen is the one-time access code text field. The ability for the user to proceed past this verification step is the correct entry of this code. There are many considerations to factor in when designing input limitations of such a code. As such, the application handles many edge cases that may occur:</p><ul><li>Formatting errors when copying and pasting a code</li><li>Unexpected whitespace introduced by different email clients when rendering the code</li><li>Changes to the format of the code, such as capitalisation style.</li><li>Entering too many characters</li></ul><p>As you can see, there are various challenges that had to be overcome when implementing this text field. In order to do so, we introduced a max length, we only permit capital letters, and we remove whitespace. These improvements ensure that what is entered is correct, serving as guidance.</p><p>The use of the <a href="https://developer.apple.com/documentation/uikit/uitextfielddelegate/1619599-textfield/">textField(_:shouldChangeCharactersIn:)</a> instance method allows us to adjust the entered string as the user types it. It works seamlessly, adopting modifiers and updating the value in real time.</p><pre>    let filteredOneTimePasscode = passcode<br>            .replacingCharacters(in: stringRange, with: string)<br>            .replacingOccurrences(of: &quot; &quot;, with: &quot;&quot;)<br>            .prefix(maxLength)<br>            <br>        textField.text = String(filteredOneTimePasscode).uppercased()<br>            .trimmingCharacters(in: .whitespaces)<br>        viewModel.passcode.value = textField.text</pre><h3>A sum of parts</h3><p>As demonstrated, there were a lot of product considerations at the core of developing this flow, ensuring that the user is assisted at every step of the MFA process. The adoption of Swift instance methods and the implementation of a reusable class for the bullet point list allowed us to build a frictionless authentication flow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a66ace912f1f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/justeattakeaway-tech/building-a-frictionless-authentication-flow-a66ace912f1f">Building a Frictionless Authentication Flow</a> was originally published in <a href="https://medium.com/justeattakeaway-tech">Just Eat Takeaway-tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>