Open hampelm opened 8 years ago
i'll work on this tonight!
try out https://data.detroitledger.org/api/1.0/userroles -- i've got branch https://github.com/detroitledger/gnl_profile/tree/userendpoint running on the server
i guess the trick would be providing a jsonp response though?
Nice! Thank you!
Looks like it'd be straightforward, so I'd suggest serving it from /api/1.0/user.jsonp
as
{
name: "matt",
id: 123,
roles: ...
}
That way we can potentially do more with it in the future.
It would be nice to have edit buttons on the front end when we're logged in
I haven't been able to find a way to do it with just the front end. I tried to make a test request to data.detroitledger.org/admin/content -- if it redirected, I'd know I can't log in. However, it rightly doesn't have CORS headers, so ajax isn't playing nice.
A simple solution would be a new API endpoint that returns current user info if you're logged in.