Skip to content

Json format #92

@Maniraj-Webner

Description

@Maniraj-Webner

I have implemented your Admad JWT CakePHP tutorial. I'm writing the API URL like this "http://localhost/api/fetch-al3-output" without "http://localhost/api/fetch-al3-output.json". It is working fine when token not expired but it throws an error when my token got expired. it gives me an error in HTML not in JSON format

Expired token

Error: The requested address '/api/fetch-al3-output' was not found on this server.

I'm converting my methods output with this code " $this->RequestHandler->renderAs($this, 'json');" but I'm not able to covert the token expired message in json format.

token_error
token_expired_json

I want to show a token expired message in JSON without using ".json" extension in URL like second screenshot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions