Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit 6b75cf5

Browse files
committed
Fixed an issue with reserved usernames on registration
1 parent 064a734 commit 6b75cf5

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

BeamAPI.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "BeamAPI"
3-
s.version = "1.2.5"
3+
s.version = "1.2.6"
44
s.summary = "An interface to communicate with Beam's backend."
55
s.homepage = "https://github.com/WatchBeam/beam-client-swift"
66
s.license = "MIT"
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.requires_arc = true
1010
s.ios.deployment_target = "8.2"
1111
s.tvos.deployment_target = "9.0"
12-
s.source = { :git => "https://github.com/WatchBeam/beam-client-swift.git", :tag => "1.2.5" }
12+
s.source = { :git => "https://github.com/WatchBeam/beam-client-swift.git", :tag => "1.2.6" }
1313
s.source_files = "Pod/Classes/**/*"
1414

1515
s.dependency "Starscream", "~> 1.1"

Pod/Classes/Utilities/BeamRequest.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ public class BeamRequest {
141141
case "string.min", "string.password": requestError = .WeakPassword
142142
default: requestError = .Unknown(data: json)
143143
}
144+
case "username":
145+
switch type {
146+
case "reserved": requestError = .ReservedUsername
147+
default: requestError = .Unknown(data: json)
148+
}
144149
default: requestError = .Unknown(data: json)
145150
}
146151
}

Pod/Classes/Utilities/BeamRequestError.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public enum BeamRequestError: Equatable, ErrorType {
2727

2828
// Registration Errors
2929
case InvalidUsername,
30+
ReservedUsername,
3031
TakenUsername,
3132
WeakPassword,
3233
InvalidEmail,
@@ -45,6 +46,7 @@ public func ==(lhs: BeamRequestError, rhs: BeamRequestError) -> Bool {
4546
case (.InvalidCredentials, .InvalidCredentials): return true
4647
case (.Requires2FA, .Requires2FA): return true
4748
case (.InvalidUsername, .InvalidUsername): return true
49+
case (.ReservedUsername, .ReservedUsername): return true
4850
case (.TakenUsername, .TakenUsername): return true
4951
case (.WeakPassword, .WeakPassword): return true
5052
case (.InvalidEmail, .InvalidEmail): return true

0 commit comments

Comments
 (0)