From e504daa53227ef27725fe4ce2d5f9510089d33e9 Mon Sep 17 00:00:00 2001 From: Nicola Carminati Date: Wed, 17 Apr 2019 14:57:28 +0200 Subject: [PATCH] Fix problems Token --- Step/Attributes/WebApiAuthorizeAttribute.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Step/Attributes/WebApiAuthorizeAttribute.cs b/Step/Attributes/WebApiAuthorizeAttribute.cs index fc41d4b9..f8a71b45 100644 --- a/Step/Attributes/WebApiAuthorizeAttribute.cs +++ b/Step/Attributes/WebApiAuthorizeAttribute.cs @@ -22,6 +22,9 @@ namespace Step protected override bool IsAuthorized(HttpActionContext actionContext) { // Get token from headers + if (actionContext.Request.Headers.Authorization == null) + return false; + string token = actionContext.Request.Headers.Authorization.ToString();