Skip to content

Commit 9086862

Browse files
authored
Merge pull request #54 from vapor/move-headers-http
move HTTP header helpers
2 parents 782e58b + 56593e0 commit 9086862

File tree

6 files changed

+11
-103
lines changed

6 files changed

+11
-103
lines changed

β€ŽPackage.swiftβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ let package = Package(
99
],
1010
dependencies: [
1111
// 🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
12-
.package(url: "https://github.com/vapor/core.git", from: "3.0.0-rc.2"),
12+
.package(url: "https://github.com/vapor/core.git", from: "3.0.0"),
1313

1414
// πŸ”‘ Hashing (BCrypt, SHA, HMAC, etc), encryption, and randomness.
15-
.package(url: "https://github.com/vapor/crypto.git", from: "3.0.0-rc.2"),
15+
.package(url: "https://github.com/vapor/crypto.git", from: "3.0.0"),
1616

1717
// πŸš€ Non-blocking, event-driven networking for Swift (HTTP and WebSockets).
18-
.package(url: "https://github.com/vapor/http.git", from: "3.0.0-rc.2"),
18+
.package(url: "https://github.com/vapor/http.git", from: "3.1.0"),
1919

2020
// πŸ–‹ Swift ORM framework (queries, models, and relations) for building NoSQL and SQL database integrations.
21-
.package(url: "https://github.com/vapor/fluent.git", from: "3.0.0-rc.2"),
21+
.package(url: "https://github.com/vapor/fluent.git", from: "3.0.0-"),
2222

2323
// πŸ“¦ Dependency injection / inversion of control framework.
24-
.package(url: "https://github.com/vapor/service.git", from: "1.0.0-rc.2"),
24+
.package(url: "https://github.com/vapor/service.git", from: "1.0.0"),
2525

2626
// πŸ’§ A server-side Swift web framework.
27-
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0-rc.2"),
27+
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
2828
],
2929
targets: [
3030
.target(name: "Authentication", dependencies: ["Async", "Bits", "Crypto", "Debugging", "Fluent", "HTTP", "Service", "Vapor"]),

β€ŽSources/Authentication/Basic/BasicAuthorization.swiftβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€ŽSources/Authentication/Basic/HTTP+Basic.swiftβ€Ž

Lines changed: 0 additions & 48 deletions
This file was deleted.

β€ŽSources/Authentication/Bearer/BearerAuthorization.swiftβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.

β€ŽSources/Authentication/Bearer/HTTP+Bearer.swiftβ€Ž

Lines changed: 0 additions & 24 deletions
This file was deleted.

β€ŽSources/Authentication/Persist/AuthenticationSessionsMiddleware.swiftβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ public final class AuthenticationSessionsMiddleware<A>: Middleware where A: Sess
2626
return future.flatMap {
2727
// respond to the request
2828
return try next.respond(to: req).map { res in
29-
// if a user is authed, store in the session
3029
if let a = try req.authenticated(A.self) {
30+
// if a user has been authed (or is still authed), store in the session
3131
try req.authenticateSession(a)
32+
} else {
33+
// if no user is authed, it's possible they've been unauthed.
34+
// remove from session.
35+
try req.unauthenticateSession(A.self)
3236
}
3337
return res
3438
}

0 commit comments

Comments
Β (0)