vapor / auth

👤 Authentication and Authorization framework for Fluent.
53 stars 34 forks source link

Request has no member 'hasSession' #67

Closed ezisxl closed 5 years ago

ezisxl commented 5 years ago

did "swift package update" swift 5, vapor toolbox 3.1.10

getting:

/private/tmp/.../.build/checkouts/auth/Sources/Authentication/Persist/SessionAuthenticatable.swift:44:19: error: value of type 'Request' has no member 'hasSession'; did you mean 'session'? guard try self.hasSession() else { ^~~~ ~~~~~~~~~~ session Vapor.Request:2:17: note: 'session' declared here public func session() throws -> Vapor.Session

ezisxl commented 5 years ago

also even after package update I'm still having Auth 2.0.2

0xTim commented 5 years ago

@ezisxl this should be fixed by 2.0.3 but basically you need to update the core Vapor framework. If swift package update doesn't work, what does your Package.swift look like?

ezisxl commented 5 years ago

Package.swift .package(url: "https://github.com/vapor/auth.git", from: "2.0.0") Package.resolved { "package": "Auth", "repositoryURL": "https://github.com/vapor/auth.git", "state": { "branch": null, "revision": "9c71c8a6c021601d981305987e8e95fd36fd0c56", "version": "2.0.2" }

0xTim commented 5 years ago

@ezisxl did you run swift package update and try building the project again?

ezisxl commented 5 years ago

same :/ - it pulls 2.0.2

0xTim commented 5 years ago

Can you post your full Package.swift?

ezisxl commented 5 years ago

import PackageDescription

let package = Package( name: "authtst", dependencies: [ // 💧 A server-side Swift web framework. .package(url: "https://github.com/vapor/vapor.git", .upToNextMinor(from: "3.1.0")), .package(url: "https://github.com/vapor/fluent-sqlite.git", .upToNextMinor(from: "3.0.0")), .package(url: "https://github.com/vapor/leaf.git", .upToNextMinor(from: "3.0.0")), .package(url: "https://github.com/vapor/auth.git", from: "2.0.2") ], targets: [ .target(name: "App", dependencies: ["Vapor", "FluentSQLite", "Leaf", "Authentication"]), .target(name: "Run", dependencies: ["App"]), .testTarget(name: "AppTests", dependencies: ["App"]), ] )

0xTim commented 5 years ago

Change your .upToNextMinor to .upToNextMajor

ezisxl commented 5 years ago

thx! that solved it