Exemple #1
0
async def __postprocess__(payload: str, context: EventContext, response: PostprocessHook) -> str:
    if payload.startswith('ok:'):
        response.set_status(200)
        response.set_header('X-Status', 'ok')
        response.set_cookie('Test-Cookie', 'ok')
        return payload
    response.set_status(400)
    response.del_cookie('Test-Cookie')
    return "not-ok: " + payload
Exemple #2
0
async def __postprocess__(payload: None, context: EventContext, *,
                          response: PostprocessHook) -> str:
    response.del_cookie(name=f"{context.app_key}.refresh",
                        path=f"{app_base_route_name(context.app)}/",
                        domain=context.auth_info.get("domain"))
    return "Logged out."