-
Notifications
You must be signed in to change notification settings - Fork 20
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
Get the currently logged in user #61
Comments
Are you looking for all users currently logged in? There could be many. Regardless, I don't think there's a REST API for that as it's not a property on the user document. |
I probably worded my question poorly. When i am using the api as a logged in user, i would like to get all information about that user (the apostrophe-user piece). Thanks in advance! |
In a view on the website i can get that information from data.user |
Hmm. For security reasons we don't currently give users any default read
access to the user piece type at all. I can see how an option to grant some
access to some safe properties of "yourself" would make sense and the door
could also get propped open to profile editing and so on, but we haven't
done that so far.
…On Tue, Nov 24, 2020 at 10:21 AM Brecht Vermeersch ***@***.***> wrote:
In a view on the website i can get that information from data.user
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27PKPICNHE4UQX2XSLDSRPFN5ANCNFSM4UA4BKOQ>
.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
(Of course if the user is an admin they can get everything they want about
users, but this is probably not your use case.)
…On Tue, Nov 24, 2020 at 11:00 AM Tom Boutell ***@***.***> wrote:
Hmm. For security reasons we don't currently give users any default read
access to the user piece type at all. I can see how an option to grant some
access to some safe properties of "yourself" would make sense and the door
could also get propped open to profile editing and so on, but we haven't
done that so far.
On Tue, Nov 24, 2020 at 10:21 AM Brecht Vermeersch <
***@***.***> wrote:
> In a view on the website i can get that information from data.user
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#61 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAH27PKPICNHE4UQX2XSLDSRPFN5ANCNFSM4UA4BKOQ>
> .
>
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Seeing this ticket has been closed, I do think it's a mistake not to implement it. Headless developers should enjoy parity with what Nunjucks and Astro-based projects have access to. So I'm bringing it back to life. Since this ticket was written we have added the So, I think we should add a separate API to fetch the same information that is always available in the "body data" if Apostrophe is fully rendering the page with Nunjucks:
I think we'd probably implement this one as:
But I'll discuss with the team. |
I think adding the email address to the list also makes sense, and it should be configurable from there. |
(Nothing is stopping any developer from writing an |
An update: I see this is on the old A2 headless module, where it definitely won't be built. But I'll open a new ticket for current Apostrophe. |
See new ticket: apostrophecms/apostrophe#4810 |
How can I get the currently logged in user (piece)?
The text was updated successfully, but these errors were encountered: