Unverified Commit 4e79d5eb authored by Tim Anema's avatar Tim Anema Committed by GitHub
Browse files

Merge pull request #23 from osmszk/additional_data_for_koa_auth

[Feature]Add missing associated user data to the session
parents 4ae1efc3 3654247c
......@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Provide user data via Koa Session
## [3.1.72] - 2020-10-16
......
......@@ -53,11 +53,17 @@ export default function createOAuthCallback(config: AuthConfig) {
}
const accessTokenData = await accessTokenResponse.json();
const {access_token: accessToken} = accessTokenData;
const {
access_token: accessToken,
associated_user_scope: associatedUserScope,
associated_user: associatedUser,
} = accessTokenData;
if (ctx.session) {
ctx.session.shop = shop;
ctx.session.accessToken = accessToken;
ctx.session.associatedUserScope = associatedUserScope;
ctx.session.associatedUser = associatedUser;
}
ctx.state.shopify = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment