我目前正在 SSR 页面中使用 PKCE 进行 oauth 2.0 代码授权授权(在前面使用 React,在后面使用 Express)。
code_verifier当客户端请求授权服务器代码时我应该存储在哪里(当授权服务器创建 code_challenge 和 code_verifier 以进行验证时)。我在独立的堆栈/基础设施中运行授权服务器。
我应该存储code_verifier在 req.headers 中吗?(参见Campbell OAuth TBPKCE-00 草案)
我们正在遵循RFC6749
您知道如何在sectionList组件React-native中制作水平截面(特定)吗?我想水平放置第二部分,我尝试使用flex:1和flexDirection:'row'修改renderItem中的项目样式,但是不起作用。任何人都知道如何设置节的自定义样式或制作水平节?(红色圆圈)
<View>
<SectionList
renderItem={({item, index, section}) => <CellMainNews isFirst={index===0 ? true: false} data={ item } onPress = {item.onPress } />}
renderSectionHeader={({section: {title}}) => (
<Text style={{fontWeight: 'bold'}}>{title}</Text>
)}
sections={[
{title: 'Top post', data: this.props.featured.top, renderItem: overrideRenderItem },
// this section
{title: 'Featured posts', data: this.props.featured.secundary, renderItem: overrideRenderItemTwo },
{title: 'Stories', data: this.props.stories},
]}
keyExtractor={(item, index) => item + index}
/>
{this.props.loading &&
<View>
<ActivityIndicator size={100} color="red" animating={this.props.loading} />
</View>
}
</View>
Run Code Online (Sandbox Code Playgroud)
问候。
我做了一个简单的函数来测试(调用)“n”个参数(函数)并将结果作为数组返回,但我不确定这是否是使用 reduce 的正确方法(检查下面的注释行)。
const sucess = () => true;
const failed = () => false;
const tester = (...args) => {
return [...args].reduce((acc,currentValue) => {
if(typeof acc === 'function') // this is right?
return [acc(),currentValue()]
return [...acc,currentValue()]
});
}
console.log(tester(sucess,failed,failed,sucess));Run Code Online (Sandbox Code Playgroud)
你是什么
ecmascript-6 ×1
function ×1
javascript ×1
node.js ×1
oauth-2.0 ×1
oauth2orize ×1
pkce ×1
react-native ×1
reactjs ×1
reduce ×1
testing ×1