Comments (3)
想到该怎么做了,直接获取 headers 里面的token值,直接到数据库里面去查一把。但是每个请求都这样做一遍就很恼火,需要找个地方封装起来方便调用
from egg-oauth2-server.
可以在 oauth.js 里写到 ctx 里
from egg-oauth2-server.
嗯嗯,我后来写到utils的扩展里了,需要的时候直接调用
from egg-oauth2-server.
Related Issues (20)
- 传入fresh_token获取新的access_token问题 HOT 13
- token存储位置 HOT 1
- 封装的 validateAccessToken 是否支持扩展? HOT 1
- support app/extend/oauth.ts HOT 2
- status code must be a number
- replaceResponse HOT 1
- Is implicit grant mode supported? HOT 3
- config文件中config.env如何获得? HOT 1
- accessTokenLifetime 配置无效 HOT 1
- grants Client Credentials HOT 3
- Missing parameter: `grant_type` HOT 1
- Saving context in application is an anti-pattern HOT 5
- 有关client grants属性的问题 HOT 5
- 有关token方法过期时间设置问题 HOT 2
- the ctx of Model can't be changed HOT 6
- Multiple model HOT 1
- How to use authenticate() as global middleware?
- 请教一个问题
- oAuth2Server.authorize()的执行结果,有生成code但后台出错,暴错内容是redirectUri指向的网页的内容。 HOT 1
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 egg-oauth2-server.