Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum TokenType: String, Codable{
- case password = "password"
- case refresh = "refresh_token"
- var value: String{
- return rawValue
- }
- }
- struct TokenRequestModel: Codable {
- let username: String
- let password: String
- let grantType: TokenType = .password
- enum CodingKeys: String, CodingKey {
- case username = "username"
- case password
- case grantType = "grant_type"
- }
- }
- struct RefreshTokenRequestModel: Codable {
- let refreshToken: String
- let grantType: TokenType = .refresh
- enum CodingKeys: String, CodingKey {
- case refreshToken = "refresh_token"
- case grantType = "grant_type"
- }
- }
Add Comment
Please, Sign In to add comment