diff --git a/Application.cs b/Application.cs
index 3efe93d..863c112 100644
--- a/Application.cs
+++ b/Application.cs
@@ -13,6 +13,8 @@ using ln.types.rpc;
using ln.application.slots;
using ln.identities;
using ln.http.session;
+using ln.json.mapping;
+using ln.application.json;
namespace ln.application
{
@@ -203,6 +205,9 @@ namespace ln.application
return pluginInstances[pluginType];
}
-
+ static Application()
+ {
+ JSONMapper.DefaultMapper.Add(new JSONIdentityMapping());
+ }
}
}
diff --git a/ApplicationSession.cs b/ApplicationSession.cs
index 3bc9ef8..74b1f48 100644
--- a/ApplicationSession.cs
+++ b/ApplicationSession.cs
@@ -60,17 +60,13 @@ namespace ln.application
if (secureAttribute.Authenticate(authenticationProve.Challenge, authenticationProve.Prove))
{
SessionIdentity = identity;
- JSONObject r = new JSONObject();
- r.Add("UniqueID", JSONMapper.DefaultMapper.ToJson(identity.UniqueID));
- r.Add("IdentityName", JSONMapper.DefaultMapper.ToJson(identity.IdentityName));
- return r;
+ return SessionIdentity;
}
else
{
+ SessionIdentity = null;
throw new ArgumentException();
}
-
- throw new KeyNotFoundException();
}
return null;
diff --git a/json/JSONIdentityMapping.cs b/json/JSONIdentityMapping.cs
new file mode 100644
index 0000000..e2de8d6
--- /dev/null
+++ b/json/JSONIdentityMapping.cs
@@ -0,0 +1,36 @@
+// /**
+// * File: JSONIdentityMapping.cs
+// * Author: haraldwolff
+// *
+// * This file and it's content is copyrighted by the Author and / or copyright holder.
+// * Any use wihtout proper permission is illegal and may lead to legal actions.
+// *
+// *
+// **/
+using System;
+using ln.json.mapping;
+using ln.identities;
+using ln.json;
+
+namespace ln.application.json
+{
+ public class JSONIdentityMapping : JSONMapping
+ {
+ public JSONIdentityMapping()
+ :base(typeof(Identity))
+ {
+ }
+
+ public override object FromJson(JSONMapper mapper, JSONValue json) => throw new NotSupportedException();
+ public override JSONValue ToJson(JSONMapper mapper, object value)
+ {
+ Identity identity = value as Identity;
+
+ JSONObject jidentity = new JSONObject();
+ jidentity.Add("UniqueID", identity.UniqueID);
+ jidentity.Add("IdentityName", identity.IdentityName);
+
+ return jidentity;
+ }
+ }
+}
diff --git a/ln.application.csproj b/ln.application.csproj
index 1ff1246..3479b2a 100644
--- a/ln.application.csproj
+++ b/ln.application.csproj
@@ -42,6 +42,7 @@
+
@@ -73,6 +74,7 @@
+
diff --git a/www b/www
index 6815c42..caff9e1 160000
--- a/www
+++ b/www
@@ -1 +1 @@
-Subproject commit 6815c42b253152f120fd74a1f0cdc0bebf071547
+Subproject commit caff9e19d57c1a2d940fbaee97cf42d679a1f16b