Reacting to HttpAbstractions changes
This commit is contained in:
parent
ef24402f1d
commit
1c986b3bb5
|
|
@ -185,7 +185,7 @@ namespace MusicStore.Models
|
|||
// We're using HttpContextBase to allow access to cookies.
|
||||
public string GetCartId(HttpContext context)
|
||||
{
|
||||
var sessionCookie = context.Request.Cookies.Get("Session");
|
||||
var sessionCookie = context.Request.Cookies["Session"];
|
||||
string cartId = null;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(sessionCookie))
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace MusicStore.Controllers
|
|||
|
||||
try
|
||||
{
|
||||
if (string.Equals(formCollection.GetValues("PromoCode").FirstOrDefault(), PromoCode,
|
||||
if (string.Equals(formCollection["PromoCode"].FirstOrDefault(), PromoCode,
|
||||
StringComparison.OrdinalIgnoreCase) == false)
|
||||
{
|
||||
return View(order);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
|||
using Microsoft.AspNet.Antiforgery;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Framework.Primitives;
|
||||
using MusicStore.Models;
|
||||
using MusicStore.ViewModels;
|
||||
|
||||
|
|
@ -61,7 +62,7 @@ namespace MusicStore.Controllers
|
|||
{
|
||||
var cookieToken = string.Empty;
|
||||
var formToken = string.Empty;
|
||||
string[] tokenHeaders = null;
|
||||
StringValues tokenHeaders;
|
||||
string[] tokens = null;
|
||||
|
||||
if (Context.Request.Headers.TryGetValue("RequestVerificationToken", out tokenHeaders))
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace MusicStore.Mocks.Facebook
|
|||
{
|
||||
if (queryParameters["code"] == "ValidCode")
|
||||
{
|
||||
Helpers.ThrowIfConditionFailed(() => queryParameters["redirect_uri"].EndsWith("signin-facebook"), "Redirect URI is not ending with /signin-facebook");
|
||||
Helpers.ThrowIfConditionFailed(() => ((string)queryParameters["redirect_uri"]).EndsWith("signin-facebook"), "Redirect URI is not ending with /signin-facebook");
|
||||
Helpers.ThrowIfConditionFailed(() => queryParameters["client_id"] == "[AppId]", "Invalid client Id received");
|
||||
Helpers.ThrowIfConditionFailed(() => queryParameters["client_secret"] == "[AppSecret]", "Invalid client secret received");
|
||||
response.Content = new StringContent("access_token=ValidAccessToken&expires=100");
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace MusicStore.Mocks.Google
|
|||
{
|
||||
if (formData["code"] == "ValidCode")
|
||||
{
|
||||
if (formData["redirect_uri"] != null && formData["redirect_uri"].EndsWith("signin-google") &&
|
||||
if (formData["redirect_uri"] != null && ((string)formData["redirect_uri"]).EndsWith("signin-google") &&
|
||||
formData["client_id"] == "[ClientId]" && formData["client_secret"] == "[ClientSecret]")
|
||||
{
|
||||
response.Content = new StringContent("{\"access_token\":\"ValidAccessToken\",\"refresh_token\":\"ValidRefreshToken\",\"token_type\":\"Bearer\",\"expires_in\":\"1200\",\"id_token\":\"Token\"}", Encoding.UTF8, "application/json");
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace MusicStore.Mocks.MicrosoftAccount
|
|||
{
|
||||
if (formData["code"] == "ValidCode")
|
||||
{
|
||||
if (formData["redirect_uri"] != null && formData["redirect_uri"].EndsWith("signin-microsoft") &&
|
||||
if (formData["redirect_uri"] != null && ((string)formData["redirect_uri"]).EndsWith("signin-microsoft") &&
|
||||
formData["client_id"] == "[ClientId]" && formData["client_secret"] == "[ClientSecret]")
|
||||
{
|
||||
response.Content = new StringContent("{\"token_type\":\"bearer\",\"expires_in\":3600,\"scope\":\"wl.basic\",\"access_token\":\"ValidAccessToken\",\"refresh_token\":\"ValidRefreshToken\",\"authentication_token\":\"ValidAuthenticationToken\"}");
|
||||
|
|
|
|||
Loading…
Reference in New Issue