authUser

Generate an access token for a Customer user.

This function takes the customers email, password and device information and returns the LoginDetails model, which contains Token.

func authUser(username: String, password: String, device: CustomerDevice, completion: @escaping (_ model: LoginDetails?, _ error: String?)->()) {
}

After LoginDetails were retrieved, the Token needs to be saved in LoyaleConfig

LoyaleConfig.shared.token = loginDetails.accessToken

What’s Next