Closed jzunigarce closed 1 year ago
@jzunigarce This is a duplicate issue.
I dont think there would be any benefits to merging the two files. Keep in mind we also have a login.js too.
signup.js (non cased version) can just be deleted.. as the cased version is what is called from the login.html
Ok, if not used file can be delete
yes signup.js can be deleted.
I am gonna fix the signUp.js in my push today.
I believe the problem is that there is no actual signup / register logic
should we provide a signup / register API, that's the logic I would write. Couldn't think of any way. Then we would need a API route for signup.
My example would need a /success page or just replace that with /dashboard.
If you send an asynchronous request to the route api/v1/login/ with the correct data (email, password) it returns a response, on the client side you can receive the response and if statusCode = 200 it means that it was correct and you can store the token and redirect right there to the dashboard page. Currently the api does not redirect you directly to the dashboard since it is designed so that different clients can consume it if necessary.
You can use fetch, axios or $.ajax for send data
@jzunigarce I added more to the signUp.js today that would technically route to /success from a API route. Can you look and see?
as for signin.js I think it was meant to be connect.js but not sure how it was intended to be used.
@gbowne1 Voy a modificar el archivo signUp,js para que se pueda registrar de manera correcta. Si se logró el registro de usuario por ahora enviaré un modal con un mensaje de éxito. Si gustas posteriormente lo modificas para que envié a otra página
Disculpe mi pobre español, está un poco oxidado.
Sí, sería una buena idea. Un modal sería bueno, pero alguna progresión de la aplicación más allá del inicio de sesión una vez exitoso sería un enlace de redirección o reenvío a /dashboard. Preferiría una alerta de Bootstrap.
Sure, I'll redirect to dashboard once login
@gbowne1 One remark, in the front-end we have the username variable, but in the api we have name, what variable will we use?
either one is fine, just as long as its the same.
I think I found a solution for this. Will push up something tonight.
@jzunigarce tonights push should fix this.
Details