{"action":"opened","issue":{"url":"https://api.github.com/repos/danieleteti/delphimvcframework/issues/48","repository_url":"https://api.github.com/repos/danieleteti/delphimvcframework","labels_url":"https://api.github.com/repos/danieleteti/delphimvcframework/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/danieleteti/delphimvcframework/issues/48/comments","events_url":"https://api.github.com/repos/danieleteti/delphimvcframework/issues/48/events","html_url":"https://github.com/danieleteti/delphimvcframework/issues/48","id":173968559,"number":48,"title":"Authentification","user":{"login":"giangianoulas","id":21333067,"avatar_url":"https://avatars.githubusercontent.com/u/21333067?v=3","gravatar_id":"","url":"https://api.github.com/users/giangianoulas","html_url":"https://github.com/giangianoulas","followers_url":"https://api.github.com/users/giangianoulas/followers","following_url":"https://api.github.com/users/giangianoulas/following{/other_user}","gists_url":"https://api.github.com/users/giangianoulas/gists{/gist_id}","starred_url":"https://api.github.com/users/giangianoulas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giangianoulas/subscriptions","organizations_url":"https://api.github.com/users/giangianoulas/orgs","repos_url":"https://api.github.com/users/giangianoulas/repos","events_url":"https://api.github.com/users/giangianoulas/events{/privacy}","received_events_url":"https://api.github.com/users/giangianoulas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-30T09:15:16Z","updated_at":"2016-08-30T09:15:16Z","closed_at":null,"body":"Using basic authentification middleware is buggy\r\nOn debug mode it works like 95% of the time, on release never \r\nI narrowed it down to this, Code starting at line 197 of MVCFramework.Middleware.Authentification\r\n`   finally\r\n      LRoles.Free;\r\n    end;\r\n  end;\r\n\r\n  // authorization\r\n  LIsAuthorized := False;\r\n  if LIsValid then\r\n  begin\r\n    FMVCAuthenticationHandler.OnAuthorization(Context.LoggedUser.Roles,\r\n      AControllerQualifiedClassName, AActionName, LIsAuthorized);\r\n  end;`\r\n\r\nThe problem is LIsValid is never set if the Context.LoggedUser.IsValid is set \r\n\r\nthis code fixes this issue\r\n\r\n`  finally\r\n      LRoles.Free;\r\n    end;\r\n  end;\r\n\r\n  if Context.LoggedUser.IsValid then\r\n    LIsValid:= True\r\n  else\r\n    LIsValid:= False;\r\n\r\n  // authorization\r\n  LIsAuthorized := False;\r\n  if LIsValid then\r\n  begin\r\n    FMVCAuthenticationHandler.OnAuthorization(Context.LoggedUser.Roles,\r\n      AControllerQualifiedClassName, AActionName, LIsAuthorized);\r\n  end;`\r\n\r\nIt is my first time posting something on guthub, any suggestions are welcome."}}
{"actor":{"display_login":"giangianoulas"}}