aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/oauth
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/oauth')
-rw-r--r--server/models/oauth/oauth-token.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts
index e3de9468e..dc8bcd872 100644
--- a/server/models/oauth/oauth-token.ts
+++ b/server/models/oauth/oauth-token.ts
@@ -126,7 +126,17 @@ getByTokenAndPopulateUser = function (bearerToken: string) {
126 where: { 126 where: {
127 accessToken: bearerToken 127 accessToken: bearerToken
128 }, 128 },
129 include: [ OAuthToken['sequelize'].models.User ] 129 include: [
130 {
131 model: OAuthToken['sequelize'].models.User,
132 include: [
133 {
134 model: OAuthToken['sequelize'].models.Author,
135 required: true
136 }
137 ]
138 }
139 ]
130 } 140 }
131 141
132 return OAuthToken.findOne(query).then(token => { 142 return OAuthToken.findOne(query).then(token => {
@@ -141,7 +151,17 @@ getByRefreshTokenAndPopulateUser = function (refreshToken: string) {
141 where: { 151 where: {
142 refreshToken: refreshToken 152 refreshToken: refreshToken
143 }, 153 },
144 include: [ OAuthToken['sequelize'].models.User ] 154 include: [
155 {
156 model: OAuthToken['sequelize'].models.User,
157 include: [
158 {
159 model: OAuthToken['sequelize'].models.Author,
160 required: true
161 }
162 ]
163 }
164 ]
145 } 165 }
146 166
147 return OAuthToken.findOne(query).then(token => { 167 return OAuthToken.findOne(query).then(token => {