public void get_access_token(HttpContext context) { String username = context.Request.Form["username"]; String password = context.Request.Form["password"]; OAuthController oauthController = new OAuthController(); OAuthViewModel oauth = null; User user = new AuthenticationController().actionCheckLoginData(username, password); if (user != null) { if (user.user_type == 4) { oauth = new OAuthViewModel(oauthController.actionGetNewTokenByUsernameAndPassword(username, password)); } } context.Response.Write(JsonConvert.SerializeObject(oauth)); }
public void get_access_token(HttpContext context) { String username = context.Request.Form["username"]; String password = context.Request.Form["password"]; OAuthController oauthController = new OAuthController(); OAuthViewModel oauth = new OAuthViewModel(); oauth.access_token = ""; User user = new AuthenticationController().actionCheckLoginData(username, password); if (user != null) { if (user.user_type == 5 || user.user_type == 6){ oauth.access_token = oauthController.actionGetNewTokenByUsernameAndPassword(username, password); } } context.Response.Write(JsonConvert.SerializeObject(oauth)); }