Comments (5)
Hey, @nmaro
Its all about to decouple oooh from express and HTTP protocol only.
The idea is to make same API to HTTP one, like POST /local/register
-> ooth.local.register()
and so on. Going this way to create an instance you need only to define what strategies should ooth
use and what backend for users to use.
It may be the best way to re-use passport strategies without actual passport.js
usage.
The express
usage may persist in some ooth-express
package, which will only call ooth.local.register()
and so on under the hood.
from ooth.
I like this
from ooth.
Good idea.
from ooth.
Hey @katsanva since I believe this will generate a major release I think we need to discuss the details a bit more.
Ooth is coupled to express, because it is coupled to passport.js which injects the user in the request and session. I think I need a better idea of where you want to make the decoupling cut. Could give some examples of
- methods that you would like to call on such a programmatic API (and what they would do).
- What you would give to the
ooth
constructor instead of an express app.
A note: the express app provided to ooth is used to
- register a few global middlewares (
cookieParser
,bodyParser
,passport
andexpressWs
) - register
express.Router
to which all routes are registered (methods called areall
,get
,ws
,post
).
from ooth.
Now every method registered with
ooth.registerMethod
can be called with ooth.callMethod
For example with ooth-local
it is now possible to run
ooth.on('register', ({_id, email, verificationToken}) => ...))
await ooth.callMethod('local', 'register', { email, password })
If this doesn't satisfy all your use cases just let me know, I'll close this for now.
from ooth.
Related Issues (20)
- This is not defined. It's defined above in another scope. I can do a pull request if you want me to... HOT 1
- Typescript HOT 3
- ooth-local-emailer url parameter HOT 1
- local-plugin: remember me HOT 3
- TypeError: Ooth is not a constructor HOT 4
- Accessing users' roles through withUser HOC HOT 1
- how to get ooth integrated and deployed in a kubernetes cluster? HOT 6
- prisma backend? HOT 2
- [Backend] Prisma Integration as alternative to mongodb HOT 10
- Passworless login using Twillio HOT 1
- Enhance ooth Documentation
- React Native error "Canβt Find Variable Self" when import { OothClient } from 'ooth-client' HOT 1
- Capcha strategy
- TypeError: ooth.usesSession is not a function
- User serialization / deserialization
- Profile on registration HOT 1
- Ooth Client headers
- oothJwt and reset password
- Is this project still maintained? HOT 1
- Wildcard Sessions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ooth.