File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const api = createApi({
23
23
// By default, if we have a token in the store, let's use that for authenticated requests
24
24
const token = ( getState ( ) as RootState ) . auth . token
25
25
if ( token ) {
26
- headers . set ( 'authentication ' , `Bearer ${ token } ` )
26
+ headers . set ( 'authorization ' , `Bearer ${ token } ` )
27
27
}
28
28
return headers
29
29
} ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const token = nanoid()
6
6
export const handlers = [
7
7
rest . get ( '/protected' , ( req , res , ctx ) => {
8
8
const headers = req . headers . all ( )
9
- if ( headers . authentication !== `Bearer ${ token } ` ) {
9
+ if ( headers . authorization !== `Bearer ${ token } ` ) {
10
10
return res (
11
11
ctx . json ( {
12
12
message : 'You shall not pass. Please login first.' ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const api = createApi({
23
23
// By default, if we have a token in the store, let's use that for authenticated requests
24
24
const token = ( getState ( ) as RootState ) . auth . token
25
25
if ( token ) {
26
- headers . set ( 'authentication ' , `Bearer ${ token } ` )
26
+ headers . set ( 'authorization ' , `Bearer ${ token } ` )
27
27
}
28
28
return headers
29
29
} ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const token = nanoid()
6
6
export const handlers = [
7
7
rest . get ( '/protected' , ( req , res , ctx ) => {
8
8
const headers = req . headers . all ( )
9
- if ( headers . authentication !== `Bearer ${ token } ` ) {
9
+ if ( headers . authorization !== `Bearer ${ token } ` ) {
10
10
return res (
11
11
ctx . json ( {
12
12
message : 'You shall not pass. Please login first.' ,
You can’t perform that action at this time.
0 commit comments