X-Git-Url: https://git.cweiske.de/stouyapi.git/blobdiff_plain/3b311577542fd5763ce22991d8e1266c636cd7ea..2baa2dec47c3704029f7d3f2f0a9d43f5bc9bafb:/www/api/razer/session.php diff --git a/www/api/razer/session.php b/www/api/razer/session.php new file mode 100644 index 0000000..e32915b --- /dev/null +++ b/www/api/razer/session.php @@ -0,0 +1,23 @@ + + * @see api/razer/session + * @see api/v1/gamers/me + */ + +if (!isset($_POST['email'])) { + header('HTTP/1.0 400 Bad Request'); + header('Content-type: application/json'); + echo '{"error":{"message":"E-Mail missing","code": 2001}}' . "\n"; + exit(1); +} +$email = $_POST['email']; + +//we use the ouya username storage code here +// and simply use the part before the @ in the e-mail as username. +list($_POST['username']) = explode('@', $email); +require __DIR__ . '/../v1/sessions.php';