Original: https://aprenent.substack.com/p/mhe-flipat-amb-replit-5-de-7
This is the continuation of the post: https://thelearningrub.substack.com/p/im-crazy-about-replit-4-of-7
Let's go back to the implementation, I gave the Agent a chance, 25 cents, to fix the error, but it failed again, so it was my turn to fix the glitch, so it was OpenAI's o1's turn to come out on top who has recently passed the "preview" period and now you don't want to know. Since I have few files and they are not very large yet, I paste the code to o1 and explain to him that this button doesn't work. o1 immediately detects that the JavaScript functions are defined outside the DOM event that belongs to him so that the button can see them, so he suggests and implements the change. I take it to the code in Replit and everything, absolutely everything, works.
So, even though the Replication Agent had screwed up, the problem had been caused by, let's say, a fairly trivial implementation error. In fact, if I had looked into it a little, I probably would have found it myself, but now, even though I know how to look at my own code, I didn't mess it up, there were already a good dozen lines of it and then, going to fix the failure was the classic and unpleasant task of fixing someone else's code. So, as a developer reviewer, which is the role you mainly play when you're running something like this, you're constantly reviewing black box code.
Okay, more or less, black box would mean only knowing the input and output. But when you have the LLM doing and undoing continuously, you lose the ability to know the code base or the architecture. This guarantees you to be agile within this code and even now, that with the Agent, the changes are incremental and you have diffs and commits, but in ChatGPT mode, that when it rotates you rewrite 80% of an already functional code… you have to be careful.
The Replit Agent had implemented correctly and at first all the functionalities that I had asked for in the first instructions, however, I had put this code “inside the wrong function.” So, instead of a total disaster, I will give it a mini-point as a positive.
Okay, let's get to serious stuff.
Add authentication
Replit has an out-of-the-box authentication module, I haven't looked at it much, but it seems to me that it sets up a simple identification screen and authenticates against Replit users. I wanted to put the authentication screen so that a horde of playful bots wouldn't come and eat up the scarce cloud resources I have contracted with Replit, but I also didn't want you to have to create a Replit user to enter my toy, it doesn't have any head or feet. I'll try it another day to understand how it works and if it's worth it.
Let's get to something serious, implementing a Google Login.
Tuned instructions:
Enhance the existing application by implementing a secure Google Login system as the initial screen. Key features include:
* Integration of Google Login as the primary authentication method
* Restriction of application access to only authenticated users
* Implementation of robust session management for active users
* Application of best security practices and attack prevention measures
The login interface should present a clean, professional appearance with Google's familiar login elements, ensuring a seamless and trustworthy user experience. The design should prioritize clarity and ease of use, maintaining consistency with the application's existing visual style.
So, here the Agent did something really cool: it interacted with me, that is, it asked me for information that it needed before continuing, since, to run Google Login, you need the keys of the Google service. The Agent will save them in a safe place, the Replication Secrets service, which will eventually become environment variables when you do the deployment. This was the query it asked me:
And… we will discuss it in the next chapter! (If it doesn't take too long :P)