Skip to content

Commit

Permalink
fix: 🐛 use childcontroller script for XSRF header to CreateItem
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikHellman committed Mar 19, 2021
1 parent 997b9b4 commit 2796875
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export class Api extends EventEmitter {
}

private async retrieveCreateItemXsrfToken() {
const url = routes.navigationControllerScript
const response = await this.fetch('navigationControllerScript', url, {})
const url = routes.childcontrollerScript
const response = await this.fetch('childcontrollerScript', url, {})
const text = await response.text()

const xsrfRegExp = /'x-xsrf-token':[ ]?'([\w\d_-]+)'/gim
Expand Down
4 changes: 3 additions & 1 deletion lib/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ export const startBundle = 'https://etjanst.stockholm.se/vardnadshavare/bundles/

export const hemPage = 'https://etjanst.stockholm.se/vardnadshavare/inloggad2/hem'

export const navigationControllerScript = 'https://etjanst.stockholm.se/vardnadshavare/bundles/navigationController'
export const navigationControllerScript = 'https://etjanst.stockholm.se/vardnadshavare/bundles/navigationController'

export const childcontrollerScript = 'https://etjanst.stockholm.se/vardnadshavare/bundles/childcontroller'

0 comments on commit 2796875

Please sign in to comment.