Search the Community
Showing results for tags 'login'.
-
Newgrounds.io allows anyone to incorporate a login system to their game. From what I understand, they login to their newgrounds account, directly in the game, and they can even have that game on their own website. In other words, they do not need to upload the game to newgrounds, yet they can still be authenticated from Newgrounds. I assume an API is used, but I'm not sure how. If cookies are stored locally, or if JWT Tokens are used. I have a multiplayer game which works using 2 separate programs: The server is run using Node.JS hosted by Heroku The client is run on a static site hosted by Netlify (it's a single page JS Canvas game) The connection is made possible using Socket.io My problem: I want the client to be able to click a button (sign in) enter their unsername and password, and submit; thus making a request over to the server, for authentication. There, the server will verify if that information is correct, and grant that user access (which would be used for saving that user's character data or inventory items). However, how do I handle...authorizing that same user if they refresh the page? How would the server know that that browser is that same computer; that same user. How would that JS static site know to check if it was logged in, or if it needs to log in? Cookies or something? JWT Tokens rings in my head, but I don't have much knowledge to say for sure if that would work. Lastly, how would I send the requests to the API? Using a socket.emit? Or should I use a fetch or axios call to the server from the static site? Then that'll lead to questions such as how to allow requests from that one specific static site, because I know of things like CORS that prevents cross...requests (or something of that sort) I would really appreciate if anyone can help in this discussion, and if they can also link to where I can find discord servers or forums that are targeted to these questions. Since it seems to me like there's a silence in information such as these, and I've been researching for months figuring out everything on my own.
-
I'm sorry if may have asked this question b4, I want to create a multiplayer game which requires the player to login, any help, Google is not providing me what I need
-
Hi, I am developing a game in phaser but I am newbie yet. I want to create a login/signup/fb form in the main screen of the game. I did a html form in the index.html of phaser, but I have some doubts. How could I achieve the communication between the html and the scenes of phaser? I created global variables, but I think that is not a good practice. Are there any options to use a state from html like MyGame.MainPage.startGame()? This is the js script of the index, the function is associated to login button: function login(){ user = check_user_in_db(); if(user){ //If the login is correct variable.startGame(); } } This is the MainPage scene of Phaser: /*********************NAMESPACE********************/ var MyGame = MyGame || {}; /**************************************************/ /******************INIT APP SCENE******************/ MyGame.MainPage = function(game) { variable = this; }; MyGame.MainPage.prototype = { init: function() { }, // init preload: function() { //load Sprites }, //preload create: function() { //create Buttons }, // create shutdown: function() { }, // shutdown startGame: function(){ this.state.start("Menu", true, false); } };