Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Laravel auth api not working


When I try to verify my token generated at login page it is giving me error and not passing through login page after successful authentication.

Request URL: https://preview.keenthemes.com/metronic8/laravel/api/verify_token
Request Method: POST
Status Code: 422 Unprocessable Content
Remote Address: 178.62.61.16:443
Referrer Policy: strict-origin-when-cross-origin


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (8)


We are using laravel 9 with sanctum for api . For frontend using React metronic theme.

login api working proper but after verify_token function call its not defined becasue of login and register not need verify_token. so please tell us how can I manage this metronic theme.



I have purchased and downloaded the theme and it had login page, on react, so while i tried to login
2 days back login api wasn't working, it was passing, null value in "api_token" variable.
now today when I checked the login api (https://preview.keenthemes.com/metronic8/laravel/api/login
), it worked and created "api_token" but now it is not verifying the token in the above link provided.



Hi Akshaya,

Are you working on the Laravel framework?
May I know, what are you doing with this URL api/verify_token?

Thanks



I have purchased and downloaded the theme and it had login page, on react, so while i tried to login
2 days back login api wasn't working, it was passing, null value in "api_token" variable.
now today when I checked the login api (https://preview.keenthemes.com/metronic8/laravel/api/login
), it worked and created "api_token" but now it is not verifying the token in the above link provided.



Hi Akshaya!

May I know which version of Metronic are you using?

We had some problems with our API in Metronic versions < v3.0.30, could you please try API in the latest Metronic version?

Thank you!



I am using metronic version of 8.0.35.
Still there is an issue with "verify_token" api.



Are you using our app/modules/auth/redux/AuthCRUD.ts to trigger api/verify_token endpoint?

As you can see on our preview page authentication works fine:
https://preview.keenthemes.com/metronic8/react/demo1/dashboard



I have purchased and downloaded the theme and it had login page, on react, so while i tried to login
2 days back login api wasn't working, it was passing, null value in "api_token" variable.
now today when I checked the login api (https://preview.keenthemes.com/metronic8/laravel/api/login
), it worked and created "api_token" but now it is not verifying the token in the above link provided.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(