Skip to content

Clarify how to use edit tokens #29

Open
@lucaswerkmeister

Description

@lucaswerkmeister

This library’s handling of edit tokens is currently a bit inconsistent, I think:

  • Most of the “crud operations” (create, edit, move etc.) read the token from this.editToken, and that member is also used once in the README. It’s not mentioned in API.md, though.
  • The token is also stored in this.state, as this.state.csrftoken.
  • getEditToken() returns a Promise that resolves with this.state, not the edit token directly. This is not documented in API.md, though.

I have no idea which of these should be used when making a request directly with request(). this.editToken looks good, but it’s unclear if it’s part of the stable interface. getEditToken() is part of the stable interface, but resolves with an undocumented value that looks more like an implementation detail than this.editToken. Can you clarify this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions