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

Request has no member 'hasSession' #67

Closed
ezisxl opened this issue Apr 18, 2019 · 9 comments
Closed

Request has no member 'hasSession' #67

ezisxl opened this issue Apr 18, 2019 · 9 comments

Comments

@ezisxl
Copy link

ezisxl commented Apr 18, 2019

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
Copy link
Author

ezisxl commented Apr 18, 2019

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

@0xTim
Copy link
Member

0xTim commented Apr 18, 2019

@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
Copy link
Author

ezisxl commented Apr 23, 2019

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
Copy link
Member

0xTim commented Apr 23, 2019

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

@ezisxl
Copy link
Author

ezisxl commented Apr 23, 2019

same :/ - it pulls 2.0.2

@0xTim
Copy link
Member

0xTim commented Apr 23, 2019

Can you post your full Package.swift?

@ezisxl
Copy link
Author

ezisxl commented Apr 23, 2019

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
Copy link
Member

0xTim commented Apr 23, 2019

Change your .upToNextMinor to .upToNextMajor

@ezisxl
Copy link
Author

ezisxl commented Apr 23, 2019

thx! that solved it

@0xTim 0xTim closed this as completed Apr 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants