小编1fa*_*ira的帖子

Passport-jwt令牌到期

我使用passport-jwt来生成我的令牌,但是我注意到令牌永不过期,是否有任何方法可以根据为我设置的规则使特定令牌无效,例如:

'use strict';
const passport = require('passport');
const passportJWT = require('passport-jwt');
const ExtractJwt = passportJWT.ExtractJwt;
const Strategy = passportJWT.Strategy;
const jwt = require('../jwt');
const cfg = jwt.authSecret();

const params = {
    secretOrKey: cfg.jwtSecret,
    jwtFromRequest: ExtractJwt.fromAuthHeader()
};

module.exports = () => {
    const strategy = new Strategy(params, (payload, done) => {
        //TODO: Create a custom validate strategy
        done(null, payload);
    });
    passport.use(strategy);
    return {
        initialize: function() {
            return passport.initialize();
        },
        authenticate: function() {
            //TODO: Check if the token is in the expired …
Run Code Online (Sandbox Code Playgroud)

node.js express jwt passport.js

6
推荐指数
1
解决办法
1万
查看次数

ScrollView 不显示内容 React-native

我正在使用 react-native 构建一个应用程序,直到我需要添加 ScrollView,无论我添加什么屏幕并且内容停止呈现,都不会显示任何错误,无论发生什么都是无声的,我已经尝试了几件事我在互联网上看到但没有解决我的问题,我在下面放了一个示例代码......

我的代码:

export default () => (
    <View style={{flex: 1}}>
        <ScrollView style={{flex: 1}}>

             // My page content here

        </ScrollView>    
    </View>
);
Run Code Online (Sandbox Code Playgroud)

显然这很简单,但我没有找到解决方案,如果有人可以帮助我,谢谢。

scrollview react-native

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

express ×1

jwt ×1

node.js ×1

passport.js ×1

react-native ×1

scrollview ×1