gbowne1 / RadioLogger

A Radio Logging application build with NodeJS and ExpressJS
GNU General Public License v3.0
6 stars 6 forks source link

signUp Duplicate file #57

Closed jzunigarce closed 1 year ago

jzunigarce commented 1 year ago

Details

gbowne1 commented 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

jzunigarce commented 1 year ago

Ok, if not used file can be delete

gbowne1 commented 1 year ago

yes signup.js can be deleted.

gbowne1 commented 1 year ago

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.

jzunigarce commented 1 year ago

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.

jzunigarce commented 1 year ago

You can use fetch, axios or $.ajax for send data

gbowne1 commented 1 year ago

@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.

jzunigarce commented 1 year ago

@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

gbowne1 commented 1 year ago

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.

jzunigarce commented 1 year ago

Sure, I'll redirect to dashboard once login

jzunigarce commented 1 year ago

@gbowne1 One remark, in the front-end we have the username variable, but in the api we have name, what variable will we use?

gbowne1 commented 1 year ago

either one is fine, just as long as its the same.

gbowne1 commented 1 year ago

I think I found a solution for this. Will push up something tonight.

gbowne1 commented 1 year ago

@jzunigarce tonights push should fix this.