Add basic session information to responses

Created on 8 August 2024, 6 months ago
Updated 12 August 2024, 6 months ago

Motivation

Ease building client-side UX items, like some custom edit/admin toolbar

Related post and example code: https://www.drupal.org/project/lupus_decoupled/issues/3357878#comment-15... πŸ“Œ Simplify authentication by leveraging CSR + CORS Active

When doing so, the question becomes: How much do we want to add to every response? We could also establish new endpoints for things like /userinfo or more site-information, possibly Drupal already offers some. But we might want to add some very basic information to the main response, which tells the frontend whether it's worth doing more requests or not.

Proposed resolution

One possible solution would be to offer some sort of configuration, a selection of permissons, and for those permissions we add the information whether the user has the permission or not the response.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria fago Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fago
  • πŸ‡ΊπŸ‡ΈUnited States glynster

    I like the idea of some granular permissions are exposed options you can add to the API.

    The simple solution of adding user info to the renderer made many things possible. Just on that level it helps with so much flexibility.

    These guys have done some interesting stuff:
    https://www.drupal.org/project/nuxtify β†’

    Mainly in regards to the API points for user info, sessions. Otherwise their approach is completely different.

    Again always happy to help where I can!

Production build 0.71.5 2024