Name

public extension Notification.Name
  • A notification that is posted when a request fails due to an invalid acces token.

    An invalid token may either be incorrect, missing or revoked.

    Upon receiving this notification on the observer, logging out the user is recommended. Logging out the user also requires their credentials and session to be reset. For example:

    AuthenticationAPI.logOut(accessToken: accessToken, completion: { result in
       switch result {
       case .success(let apiResponse):
           API.shared.deleteCredentials()
           API.shared.resetSession()
           // Other log out events
       case .failure(let error):
           // Handle error
       }
    })
    

    Declaration

    Swift

    static let APIAccessTokenDidBecomeInvalid: Notification.Name