Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with CocoaPods #157

Merged
merged 3 commits into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
3.2
3 changes: 2 additions & 1 deletion OneTimePassword.podspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Pod::Spec.new do |s|
s.name = "OneTimePassword"
s.version = "3.0"
s.version = "3.0.1"
s.summary = "A small library for generating TOTP and HOTP one-time passwords."
s.homepage = "https://github.com/mattrubin/OneTimePassword"
s.license = "MIT"
s.author = "Matt Rubin"
s.swift_version = "3.2"
s.ios.deployment_target = "8.0"
s.watchos.deployment_target = "2.0"
s.source = { :git => "https://github.com/mattrubin/OneTimePassword.git", :tag => s.version }
Expand Down
4 changes: 2 additions & 2 deletions Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0</string>
<string>3.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.0</string>
<string>3.0.1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Token+URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ private func token(from url: URL, secret externalSecret: Data? = nil) -> Token?
return nil
}

var name = Token.defaultName
var name = ""
let path = url.path
if path.characters.count > 1 {
// Skip the leading "/"
name = path.substring(from: path.characters.index(after: path.startIndex))
}

var issuer = Token.defaultIssuer
var issuer = ""
if let issuerString = queryDictionary[kQueryIssuerKey] {
issuer = issuerString
} else {
Expand Down
10 changes: 1 addition & 9 deletions Sources/Token.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,12 @@ public struct Token: Equatable {
/// - parameter generator: The password generator.
///
/// - returns: A new token with the given parameters.
public init(name: String = defaultName, issuer: String = defaultIssuer, generator: Generator) {
public init(name: String = "", issuer: String = "", generator: Generator) {
self.name = name
self.issuer = issuer
self.generator = generator
}

// MARK: Defaults

/// The default token name, an empty string.
internal static let defaultName: String = ""

/// The default token issuer, an empty string.
internal static let defaultIssuer: String = ""

// MARK: Password Generation

/// Calculates the current password based on the token's generator. The password generated will
Expand Down