Note that there are some explanatory texts on larger screens.

plurals
  1. POIssues with CurrentUserPropertyBinder it cannot always remember user
    primarykey
    data
    text
    <p>I have implemented a <strong>CurrentUserPropertyBinder</strong> (see below) for a web application using FubuMVC.</p> <pre><code>public class CurrentUserPropertyBinder : IPropertyBinder { private readonly Database _database; private readonly ISecurityContext _security; public CurrentUserPropertyBinder(Database database, ISecurityContext security) { _database = database; _security = security; } public bool Matches(PropertyInfo property) { return property.PropertyType == typeof(User) &amp;&amp; property.Name == "CurrentUser"; } public void Bind(PropertyInfo property, IBindingContext context) { var currentUser = //check database passing the username to get further user details using _security.CurrentIdentity.Name property.SetValue(context.Object, currentUser, null); } } </code></pre> <p>When I login to my site, this works fine. The <strong>CurrentUserPropertyBinder</strong> has all the information it requires to perform the task (i.e. <strong>_security.CurrentIdentity.Name</strong> has the correct User details in it)</p> <p>When I try and import a file using fineUploader (<a href="http://fineuploader.com/" rel="nofollow">http://fineuploader.com/</a>) which opens the standard fileDialog the <strong>_security.CurrentIdentity.Name</strong> is empty. </p> <p>It doesn't seem to remember who the user was, I have no idea why. It works for all my other routes but then I import a file it will not remember the user.</p> <p>Please help! Thanks in Advance</p> <p>NOTE: We are using FubuMVC.Authentication to authenticate the users</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload