Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #54 from vapor/move-headers-http
Browse files Browse the repository at this point in the history
move HTTP header helpers
  • Loading branch information
tanner0101 authored Aug 14, 2018
2 parents 782e58b + 56593e0 commit 9086862
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 103 deletions.
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ let package = Package(
],
dependencies: [
// 🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
.package(url: "https://github.com/vapor/core.git", from: "3.0.0-rc.2"),
.package(url: "https://github.com/vapor/core.git", from: "3.0.0"),

// 🔑 Hashing (BCrypt, SHA, HMAC, etc), encryption, and randomness.
.package(url: "https://github.com/vapor/crypto.git", from: "3.0.0-rc.2"),
.package(url: "https://github.com/vapor/crypto.git", from: "3.0.0"),

// 🚀 Non-blocking, event-driven networking for Swift (HTTP and WebSockets).
.package(url: "https://github.com/vapor/http.git", from: "3.0.0-rc.2"),
.package(url: "https://github.com/vapor/http.git", from: "3.1.0"),

// 🖋 Swift ORM framework (queries, models, and relations) for building NoSQL and SQL database integrations.
.package(url: "https://github.com/vapor/fluent.git", from: "3.0.0-rc.2"),
.package(url: "https://github.com/vapor/fluent.git", from: "3.0.0-"),

// 📦 Dependency injection / inversion of control framework.
.package(url: "https://github.com/vapor/service.git", from: "1.0.0-rc.2"),
.package(url: "https://github.com/vapor/service.git", from: "1.0.0"),

// 💧 A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0-rc.2"),
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
],
targets: [
.target(name: "Authentication", dependencies: ["Async", "Bits", "Crypto", "Debugging", "Fluent", "HTTP", "Service", "Vapor"]),
Expand Down
14 changes: 0 additions & 14 deletions Sources/Authentication/Basic/BasicAuthorization.swift

This file was deleted.

48 changes: 0 additions & 48 deletions Sources/Authentication/Basic/HTTP+Basic.swift

This file was deleted.

10 changes: 0 additions & 10 deletions Sources/Authentication/Bearer/BearerAuthorization.swift

This file was deleted.

24 changes: 0 additions & 24 deletions Sources/Authentication/Bearer/HTTP+Bearer.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ public final class AuthenticationSessionsMiddleware<A>: Middleware where A: Sess
return future.flatMap {
// respond to the request
return try next.respond(to: req).map { res in
// if a user is authed, store in the session
if let a = try req.authenticated(A.self) {
// if a user has been authed (or is still authed), store in the session
try req.authenticateSession(a)
} else {
// if no user is authed, it's possible they've been unauthed.
// remove from session.
try req.unauthenticateSession(A.self)
}
return res
}
Expand Down

0 comments on commit 9086862

Please sign in to comment.