When I sending request to register in post man i get this error how can i solve it?

|
cccr85 2021-12-18 12:59:55
i not see error
Ruba00 2021-12-18 13:01:12
Ruba00 2021-12-18 12:42:14
Hello, when I sending request to register in post man i get this error how can i solve it?

My error in postman

cccr85 2021-12-18 13:01:42
Ruba00 2021-12-18 13:01:12
My error in postman

you need add auth_key in postman query header

Ruba00 2021-12-18 13:03:51
cccr85 2021-12-18 13:01:42
you need add auth_key in postman query header

how?😅

cccr85 2021-12-18 13:36:30
1. Send login request. Request return auth_key
2. Add this auth_key to next request
Ruba00 2021-12-18 16:23:46
cccr85 2021-12-18 13:36:30
1. Send login request. Request return auth_key
2. Add this auth_key to next request

I want to registar first to give me token then login and put the given token to other requests(index,show,…)

Ruba00 2021-12-18 16:24:43
but in registar i have error
vahidizdr 2021-12-18 16:25:51
Ruba00 2021-12-18 12:42:14
Hello, when I sending request to register in post man i get this error how can i solve it?

You need to send CSRF token as well, or you can put all of the api routes on the csrf ignore list

Jomitz 2021-12-18 16:33:30
Ruba00 2021-12-18 12:59:12

Show the controller code

Jomitz 2021-12-18 16:34:59
Ruba00 2021-12-18 12:59:12

If you are using the form request for validatio as by default the authoruze funtion will be set to false you need to change it to true

Ruba00 2021-12-18 16:38:32
Jomitz 2021-12-18 16:33:30
Show the controller code

laravel_discuss-102617.jpg

Ruba00 2021-12-18 16:39:28
laravel_discuss-102618.jpg

bryan_king 2021-12-18 16:44:21
GopalAryaExplorer 2021-12-18 10:31:22
Anyone can help me to resolve this issue

Check the logs

cccr85 2021-12-18 16:48:04
api routes in /routes/api.php

web routes in /routes/web.php

you put you routes in web.php, and you have error csrf

You have 2 way.

1. Create routes in api.php and get auth_key from this routes

and

2. Open in broswer register page. Register. Auth. And put auth_key in you request

Ruba00 2021-12-18 16:51:00
Ruba00 2021-12-18 12:59:12

but my routes in api.php

ibrahim 2021-12-18 18:20:44
Lessh
natghi2010 2021-12-18 18:42:14
Ruba00 2021-12-18 12:59:12

This is wrong code

Ruba00 2021-12-18 18:49:32
natghi2010 2021-12-18 18:42:14
This is wrong code

All wrong?

natghi2010 2021-12-18 19:01:21
Ruba00 2021-12-18 18:49:32
All wrong?

You have too many lines

natghi2010 2021-12-18 19:01:51
2 middleware where there only needs 1
natghi2010 2021-12-18 19:02:24
5 routes where there only needs to be 1
Doniyorbek8069 2021-12-18 19:25:41
Code?
Doniyorbek8069 2021-12-18 19:26:32
Read or insert
martianartisan 2021-12-18 20:27:17
[‘info’ => $info]
Patel Tarachand 2021-12-18 21:12:08
Use
return view(‘home’s, compact(‘info’))
ukforizone 2021-12-18 21:13:44
laravel_discuss-102647.jpg

ukforizone 2021-12-18 21:14:02
Wy i am getting this error can anyone help me
Abiodun_Web 2021-12-18 21:14:38
Do you have that method called in your controller?
omarkhanprog 2021-12-19 00:20:21
themanojyadav 2021-12-16 22:52:27
Use laravel sanctum or ignore the api routes for csrf check.

which File ?

bryan_king 2021-12-19 00:20:32
natghi2010 2021-12-18 19:01:21
You have too many lines

How does this solve his problem? He is not looking for advice on clean code but wants a solution to his problem

bryan_king 2021-12-19 00:20:57
Ruba00 2021-12-18 16:51:00
but my routes in api.php

Try route:clear

twitchnyc 2021-12-19 00:31:39
Anyone here with any bank validator ?
themanojyadav 2021-12-19 06:28:49
omarkhanprog 2021-12-19 00:20:21
which File ?

Verify csrf token in middleware

natghi2010 2021-12-19 08:00:59
bryan_king 2021-12-19 00:20:32
How does this solve his problem? He is not looking for advice on clean code but wants a solution to his problem

Well, by manually generating his own routes, hes opened himself to future problems.

natghi2010 2021-12-19 08:07:23
His current problem is that he didnt read enough on authentication before starting development
|