side-project-at-SPT / split-rails

game split implemented by rails
0 stars 1 forks source link

大平台結束遊戲API #6

Closed tom00502 closed 3 months ago

tom00502 commented 3 months ago

Do this!!

End of the game

Once the game is over, frontend can call the following endpoint to close the game, and close the iframe window as well.

request

POST 'https://spt-games-split.zeabur.app/api/v1/games/${GAME_ID}/end-game-via-gaas-token'
Headers: 'Authorization: Bearer ${TOKEN_FROM_GAAS}'

response

// 200
{
  "message": "Game ended"
}

// 422
{
  "message": "Failed to end game"
}
noracami commented 3 months ago

completed

noracami commented 3 months ago

Btw (in the future) I'd like to use the GaaS token(Auth0 token) in whole processes. So that client don't need to keep 2 jwt at the same time 🤣