summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/api/login.h
blob: 3479ae75ff270c97572bfb52feffcae41fb266da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _STEAM_REQUEST_LOGIN_H_
#define _STEAM_REQUEST_LOGIN_H_

class LogonRequest : public HttpRequest
{
public:
	LogonRequest(const char *token) :
		HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Logon/v0001")
	{
		char data[256];
		mir_snprintf(data, "access_token=%s&ui_mode=web", token);

		Content = new FormUrlEncodedContent(this)
			<< CHAR_PARAM("access_token", token)
			<< CHAR_PARAM("ui_mode", "web");
	}
};

class LogoffRequest : public HttpRequest
{
public:
	LogoffRequest(const char *token, const char *umqId) :
		HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Logoff/v0001")
	{
		Content = new FormUrlEncodedContent(this)
			<< CHAR_PARAM("access_token", token)
			<< CHAR_PARAM("umqid", umqId);
	}
};

#endif //_STEAM_REQUEST_LOGIN_H_