You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the requests are handled by authPage and auth's login function only takes the token.
Instead IMO its is better to isolate the login entirely into auth and let authPage do the work of fetching the values from the form and passing it to auth. So basically have the following two functions in auth.login (email, password, callback) and auth.register (email, password, name, callback) and let them do the requests to the backend also.
Currently the requests are handled by
authPage
andauth
's login function only takes the token.Instead IMO its is better to isolate the login entirely into
auth
and letauthPage
do the work of fetching the values from the form and passing it toauth
. So basically have the following two functions inauth.login (email, password, callback)
andauth.register (email, password, name, callback)
and let them do the requests to the backend also.Callbacks ref: http://javascriptissexy.com/understand-javascript-callback-functions-and-use-them/
The text was updated successfully, but these errors were encountered: