Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Meteor 3.0 #21

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Migration to Meteor 3.0 #21

wants to merge 16 commits into from

Conversation

jankapunkt
Copy link
Member

This PR makes the package fully aware of Meteor 3, where all DB calls in model, but also routes and higher level functions are now fully async/await compatible.

@jeffreyflynt
Copy link

jeffreyflynt commented Jul 23, 2024

I believe to complete this, these would need to be modified:

https://github.com/leaonline/oauth2-server/blob/master/lib/webapp.js#L8

From: const server = WebApp.connectHandlers
To: const server = WebApp.handlers

Reference: https://docs.meteor.com/changelog

Packages updated here: https://github.com/leaonline/oauth2-server/blob/master/package.js

@jankapunkt
Copy link
Member Author

@jeffreyflynt actually the switch to express demanded even bigger changes, including changes in the respective accounts-* and accounts-oauth-* libs.

Took me two days to fully debug and update. Will push, once code is cleaned up and documented.

@jeffreyflynt
Copy link

When I migrated to Meteor 3, I noticed I had to do the below; otherwise: Invalid Request shows in the browser on the root route. I haven't been able to track down as to why the change moving to Meteor 3 yet.

oauth2server.app.use('*', function (req, res, next) {
  res.writeHead(404)
  res.end('route not found')
})

to

oauth2server.app.use('/oauth/*', function (req, res, next) {
  res.writeHead(404)
  res.end('route not found')
})

@jankapunkt
Copy link
Member Author

@jeffreyflynt yes I removed the '*' entirely. Meteor 3 now uses express as their http middleware library, which was connect beforehand. This also means, that if you implement a route (for example using oauth2server.secureHandler function) you need to change a few things on req/res to make it work with express.

Implements Refresh Token Flow for Meteor 3
@jankapunkt
Copy link
Member Author

This is on stale until we get code-coverage fixed for package-tests in Meteor 3, see serut/meteor-coverage#95 which is currently blocked due to meteor/meteor#13287

@jankapunkt
Copy link
Member Author

Published 6.0.0-rc.1, feel free to test via meteor add leaonline:[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants