Save serialized squad to backend with given name and additional data.
If id
is null, saves a new squad. Otherwise, saves squad to id
.
name
must be unique among user squads.
additional_data
includes stuff like
description
points
cards used
When finished, calls cb({ id: ..., success: true|false })
.
Deletes squad with given id
from backend.
When finished, calls cb({ success: true|false })
.
Lists all saved squads of given builder.faction
for this user. Description is a summary of pilots, etc.
Displays modal of squads for user to select.
If all
is true
, lists squads for everyone in the system.
Called by the login child window when OAuth authentication is complete. Confirms authentication with the server and calls cb
when done. Sets internal authentication state.
Returns true if authenticated.
Starts login process.
Logs out. Clears internal authentication state.
Doesn't really do anything of note.
Returns 200.
Get list of OAuth methods supported.
Returns { methods: [ 'foo', 'bar', ... ] }
Logs in using OAuth for given method. Begins OAuth token exchange redirection dance.
Callback from successful OAuth. Signals window.parent
that authorization is complete.
Invalidate user session. Returns 200.
Fetch list of squads for authenticated user. This is what list()
connects to.
Returns { "Rebel Alliance": [ ... ], "Galactic Empire": [ ... ] }
.
Each item in the list is { name: ..., id: ..., points: ..., description: ..., additional_data: ... }
.
Fetch list of squads for all users. This is what list()
connects to. Unprotected.
Save new squad.
PUT data: { name: ..., serialized: ..., faction: ..., additional_data: {...} }
Returns { id: ..., success: true|false, error: ... }
Update squad.
POST data { name: ..., serialized: ..., faction: ..., additional_data: {...} }
Returns: { id: ..., success: true|false, error: ... }
Check if a squad name is available for use by user.
POST data { name: ... }
Returns: { available: true|false }
Delete squad.
Returns { success: true|false, error: ... }
.
Used to check session authentication. Returns { success: true }
or 403.
bundle install --path vendor/bundle
bundle update
env ALLOWED_ORIGINS='localhost' SESSION_SECRET=abc bundle exec rackup config.ru