Skip to content

Commit

Permalink
add: redirect handler for invalid session check
Browse files Browse the repository at this point in the history
  • Loading branch information
developerfromjokela committed Jan 30, 2023
1 parent 4384e72 commit 04d0745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/openwilma/Clients/WilmaHTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Alamofire

struct WilmaRedirectHandler: RedirectHandler {
func task(_ task: URLSessionTask, willBeRedirectedTo request: URLRequest, for response: HTTPURLResponse, completion: @escaping (URLRequest?) -> Void) {
if ((response.url?.query?.contains("invalidsession")) != nil) {
if ((response.url?.query?.contains("invalidsession")) == true) {
var newReq = request
newReq.url = URL(string: (request.url?.baseURL?.formatted() ?? "")+"/messages/index_json", relativeTo: request.url)
completion(newReq)
Expand Down

0 comments on commit 04d0745

Please sign in to comment.