aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/oauth
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-24 19:41:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 09:11:38 +0200
commit72c7248b6fdcdb2175e726ff51b42e7555f2bd84 (patch)
tree1bfdee99dbe2392cc997edba8e314e2a8a401c72 /server/models/oauth
parent8113a93a0d9f31aa9e23702bbc31b8a76275ae22 (diff)
downloadPeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.gz
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.zst
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.zip
Add video channels
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 => {