cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering verification address but it requires authorization

0 Kudos
227

Hi all,

am using Spartacus 3.2 version and am manually triggering the verify address API for the anonymous users because the very first-time addAddress API is getting failed so I am triggering manually. but it requires an authorization token.below is my code:

'private occEndpoints: OccEndpointsService,

verifyaddress(address: Address):Observable<any> {

const actionAllowed = this.actionAllowed();

let headers = new HttpHeaders({

'Content-Type': 'application/json',

}) let userId;

this.userIdService

.getUserId()

.subscribe((occUserId) => (userId = occUserId))

.unsubscribe()

return this.http.post<any>(

this.occEndpoints.getUrl('addressVerification',{userId,address}, ),{},{}

); }

Below is the response api:

users/anonymous/addresses/verification?lang=en_GB&curr=GBP

Request Method: POST

  1. Status Code: 401 Unauthorized
  2. Remote Address: 127.0.0.1:4200
  3. Referrer Policy: strict-origin-when-cross-origin

Accepted Solutions (0)

Answers (0)