Skip to content
Snippets Groups Projects
Commit 55a3f915 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Make bearer token optional

parent 70342fd8
Branches
No related tags found
No related merge requests found
......@@ -36,9 +36,9 @@ public struct BasicAuthentication: Authentication
public struct BearerToken: Authentication
{
private let token: String
private let token: String?
public init(token: String) {
public init(token: String?) {
self.token = token
}
......@@ -46,6 +46,9 @@ public struct BearerToken: Authentication
"Authorization"
}
public var headerValue: String? {
guard let token = token else {
return nil
}
return "Bearer \(token)"
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment