Passing error from server side to client side (invite code verification)

I have a simple register page with a user name and password and an invite code input field. I’ve managed to develop the server side stuff with a condition that only adds a user to the database if it matches the invite
code that I set. All fine.

However, when the user’s invite code is not matched, what is the best way to notify the user? In other words, how can I pass on this error code to the client side?

Can someone point me in the right direction?

Community Page
Last updated: