Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an endpoint with current user info #152

Open
hampelm opened this issue Oct 1, 2016 · 5 comments
Open

Add an endpoint with current user info #152

hampelm opened this issue Oct 1, 2016 · 5 comments
Assignees
Labels

Comments

@hampelm
Copy link
Member

hampelm commented Oct 1, 2016

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.

@hampelm hampelm added the API label Oct 1, 2016
@bnchdrff
Copy link
Member

bnchdrff commented Oct 3, 2016

i'll work on this tonight!

@bnchdrff bnchdrff self-assigned this Oct 3, 2016
@bnchdrff
Copy link
Member

bnchdrff commented Oct 4, 2016

@bnchdrff
Copy link
Member

bnchdrff commented Oct 4, 2016

i guess the trick would be providing a jsonp response though?

@bnchdrff
Copy link
Member

bnchdrff commented Oct 4, 2016

@hampelm
Copy link
Member Author

hampelm commented Oct 5, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants