CSRFTokenStorage
open class CSRFTokenStorage : CSRFTokenStoring
default implementation for CSRFTokenStoring protocol
-
The store to use when handling CSRF token
Declaration
Swift
open var store: CodableStoring -
Initializes a
DefaultTokenStoreinstanceDeclaration
Swift
public init(store: CodableStoring) -
Stores the CSRF token for the given URL.
Declaration
Swift
public func store(token: String, for url: URL) throwsParameters
tokenthe CSRF token to be stored
forthe url the token is associated to
-
Retrieves the CSRF token for the given URL.
Declaration
Swift
public func token(for url: URL) throws -> String?Parameters
urlthe url which the csrf token is needed for
Return Value
the token associated with the url, nil if not found
-
Deletes the CSRF token for the given URL.
Declaration
Swift
public func deleteToken(for url: URL) throwsParameters
urlthe url which the csrf token is no longer needed