update
This commit is contained in:
@@ -148,7 +148,7 @@ def enroll(
|
|||||||
ttl_expiration = ttl(start_dt=now_, days=course.access_period - offset_days)
|
ttl_expiration = ttl(start_dt=now_, days=course.access_period - offset_days)
|
||||||
transact.put(
|
transact.put(
|
||||||
item={
|
item={
|
||||||
'id': 'lock',
|
'id': 'LOCK',
|
||||||
'sk': lock_hash,
|
'sk': lock_hash,
|
||||||
'enrollment_id': enrollment.id,
|
'enrollment_id': enrollment.id,
|
||||||
'created_at': now_,
|
'created_at': now_,
|
||||||
@@ -160,7 +160,7 @@ def enroll(
|
|||||||
transact.put(
|
transact.put(
|
||||||
item={
|
item={
|
||||||
'id': enrollment.id,
|
'id': enrollment.id,
|
||||||
'sk': 'lock',
|
'sk': 'LOCK',
|
||||||
'hash': lock_hash,
|
'hash': lock_hash,
|
||||||
'created_at': now_,
|
'created_at': now_,
|
||||||
'ttl': ttl_expiration,
|
'ttl': ttl_expiration,
|
||||||
@@ -170,14 +170,14 @@ def enroll(
|
|||||||
transact.put(
|
transact.put(
|
||||||
item={
|
item={
|
||||||
'id': enrollment.id,
|
'id': enrollment.id,
|
||||||
'sk': 'metadata#deduplication_window',
|
'sk': 'METADATA#DEDUPLICATION_WINDOW',
|
||||||
'offset_days': offset_days,
|
'offset_days': offset_days,
|
||||||
'created_at': now_,
|
'created_at': now_,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
transact.condition(
|
transact.condition(
|
||||||
key=KeyPair('lock', lock_hash),
|
key=KeyPair('LOCK', lock_hash),
|
||||||
cond_expr='attribute_not_exists(sk)',
|
cond_expr='attribute_not_exists(sk)',
|
||||||
exc_cls=DeduplicationConflictError,
|
exc_cls=DeduplicationConflictError,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -30,12 +30,6 @@ export async function loader({ request, context }: Route.LoaderArgs) {
|
|||||||
redirect: 'manual'
|
redirect: 'manual'
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('Issuer response', {
|
|
||||||
json: await r.json(),
|
|
||||||
headers: r.headers,
|
|
||||||
status: r.status
|
|
||||||
})
|
|
||||||
|
|
||||||
if (r.status === httpStatus.FOUND) {
|
if (r.status === httpStatus.FOUND) {
|
||||||
return new Response(await r.text(), {
|
return new Response(await r.text(), {
|
||||||
status: r.status,
|
status: r.status,
|
||||||
@@ -43,6 +37,12 @@ export async function loader({ request, context }: Route.LoaderArgs) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('Issuer response', {
|
||||||
|
json: await r.json(),
|
||||||
|
headers: r.headers,
|
||||||
|
status: r.status
|
||||||
|
})
|
||||||
|
|
||||||
// Deny authorization if user lacks scopes requested by client
|
// Deny authorization if user lacks scopes requested by client
|
||||||
if (r.status === httpStatus.FORBIDDEN) {
|
if (r.status === httpStatus.FORBIDDEN) {
|
||||||
return new Response(null, {
|
return new Response(null, {
|
||||||
|
|||||||
Reference in New Issue
Block a user