How to do http call then according return value and decide to login or not on client side

I’m trying to make a http call to my server first to check the username is exist or not ,then according to the result ,decide keep excuting login method by using meteor account .but on the client side ,I cannot do these things synchronously .
What should I do or could you guys give me some alternative options? Any help will do ,thanks a lot .

Never do anything which can expose a security loophole from the client. In this case, if you use the client to make an HTTP call and then decide on what you’re going to do, it makes it really easy to hack that execution flow and “authorise” any request.

If you really want this pattern, then you must do it on the server. Meteor makes it really easy to perform sync-style HTTP calls, and this could be hooked into Meteor’s standard login flow.

thank you.I will try to do it from server side.

1 Like