Skip to content

Commit 3ff529c

Browse files
author
Dusko Bogdanovski
committed
Update user token model
1 parent a5ce347 commit 3ff529c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ckanext/oauth2/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def by_user_name(cls, user_name):
3939
sa.Column('user_name', sa.types.UnicodeText, primary_key=True),
4040
sa.Column('access_token', sa.types.UnicodeText),
4141
sa.Column('token_type', sa.types.UnicodeText),
42-
sa.Column('refresh_token', sa.types.UnicodeText),
42+
sa.Column('expires_at', sa.types.UnicodeText),
4343
sa.Column('expires_in', sa.types.UnicodeText)
4444
)
4545

ckanext/oauth2/oauth2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_stored_token(self, user_name):
159159
if user_token:
160160
return {
161161
'access_token': user_token.access_token,
162-
'refresh_token': user_token.refresh_token,
162+
'expires_at': user_token.expires_at,
163163
'expires_in': user_token.expires_in,
164164
'token_type': user_token.token_type
165165
}
@@ -173,7 +173,7 @@ def update_token(self, user_name, token):
173173
# Save the new token
174174
user_token.access_token = token['access_token']
175175
user_token.token_type = token['token_type']
176-
user_token.refresh_token = token['refresh_token']
176+
user_token.expires_at = token['expires_at']
177177
user_token.expires_in = token['expires_in']
178178
model.Session.add(user_token)
179179
model.Session.commit()

0 commit comments

Comments
 (0)