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 DefaultTokenStore instance

    Declaration

    Swift

    public init(store: CodableStoring)
  • Stores the CSRF token for the given URL.

    Declaration

    Swift

    public func store(token: String, for url: URL) throws

    Parameters

    token

    the CSRF token to be stored

    for

    the 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

    url

    the 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) throws

    Parameters

    url

    the url which the csrf token is no longer needed