Amplify OAUTH provider only call with 1 scope

I have setup an OAUTH provider with Amplify (LinkedIn) but the URL called contains only 1 scope even though my scope array contains several in the configuration. Is it possible to specify to Amplify the scopes we want to include specifically?

amplify_outputs.json:

{
  "auth": {
    "user_pool_id": "eu-west-3_[REDACTED]",
    "aws_region": "eu-west-3",
    "user_pool_client_id": "[REDACTED]",
    "identity_pool_id": "eu-west-3:[REDACTED]",
    "mfa_methods": [],
    "standard_required_attributes": [
      "email"
    ],
    "username_attributes": [
      "email"
    ],
    "user_verification_types": [
      "email"
    ],
    "groups": [],
    "mfa_configuration": "NONE",
    "password_policy": {
      "min_length": 8,
      "require_lowercase": true,
      "require_numbers": true,
      "require_symbols": true,
      "require_uppercase": true
    },
    "oauth": {
      "identity_providers": [],
      "redirect_sign_in_uri": [
        "http://localhost:3000/dashboard"
      ],
      "redirect_sign_out_uri": [
        "http://localhost:3000/"
      ],
      "response_type": "code",
      "scopes": [
        "phone",
        "email",
        "openid",
        "profile",
        "aws.cognito.signin.user.admin"
      ],
      "domain": "[REDACTED].auth.eu-west-3.amazoncognito.com"
    },
    "unauthenticated_identities_enabled": true
  },
  "version": "1.4"
}

Call API:

export const registerWithLinkedIn = async () => {
  await signInWithRedirect({
    provider: {
      custom: 'LinkedIn'
    }
  });
}

URL called:

https://www.linkedin.com/oauth/v2/authorization?client_id=[REDACTED]&redirect_uri=[REDACTED].auth.eu-west-3.amazoncognito.com%2Foauth2%2Fidpresponse&scope=openid%2Cemail&response_type=code&state=...

Show validations errors in inertia

I tried to show Validation Errors in template, as the code below it just shows the errors of success and failed, but if i submit the form without write anything, it doesn’t show any message of validation errors, how can i solve it ?

enter image description here

public function edit() {

    return Inertia::render('Settings', [

        'success' => session('success'),

        'failed' => session('failed'),
        
    ]);

}

public function update(Request $request) {

    $request->validate([

        'oldPassword' => 'required|string',

        'newPassword' => 'required|string|min:8',

    ]);

    $userData = User::findOrFail(auth()->id());

    if(!Hash::check($request->oldPassword, $userData->password)) {

        return redirect()->back()->with([

            'failed' => 'Invalid Password !'

        ]);

    }

    $userData->update([

        'password' => Hash::make($request->newPassword),

    ]);

    return redirect()->back()->with([

        'success' => 'Successfully Updated Password'

    ]);

}

Prisma Client Not Generating in Next.JS (or at least type definitions)?

I am using next.js with ts, prisma, and neon. I am trying to create a webhook for Clerk, when a user is created, to take that information and add it to my database.

if (evt.type === 'user.created'){
      console.log("User Created Event Fired!!")
      try {
        const newUser = await prisma.user.create({
      
        id: evt.data.id as string,
        email: evt.data.email_addresses[0]?.email_address,
        name: `${evt.data.first_name || ''} ${evt.data.last_name || ''}`.trim(),

      
    });
    console.log(`User created in database: ${evt.data.id}`);
    return new Response('Create User Webhook received', { status: 200 })
}catch (err) {
  console.error('Error verifying webhook:', err)
  return new Response('Error verifying webhook', { status: 400 })
}}

The schema looks correct:

model User {
  id            String           @id @unique
  clerkId       String           @unique
  email         String           @unique
  name          String
  gbp           GBP[]
  subscription  SubscriptionType @default(FREE)
  createdAt     DateTime         @default(now())
  updatedAt     DateTime         @updatedAt
}

I have run prisma migrate dev , prisma db push, prisma generate, and just about every other command that I thought would transfer over the schema accurately to the client.

But no matter what I do, the error returns:

entInvalid `prisma.user.create()` invocation:

{
  id: "user_29w83sxmDNGwOuEthce5gg56FcC",
  ~~
  email: "[email protected]",
  name: "Example Example",
? data?: UserCreateInput | UserUncheckedCreateInput
}

Unknown argument `id`. Available options are marked with ?.er code here

Any ideas? I am getting ready to trash Prisma for something else because I just cannot get this figured out.

React 19: Component rendered with ReactDOM.createRoot inside useEffect fails to appear on initial load (worked in React 18)

I’m migrating an app from React 18.3.1 / React-DOM 18.3.1 to React 19.1.0 / React-DOM 19.1.0.
With React 18 the code below rendered an EditView component into every DOM element that SurveyJS inserts with the class .editViewContainer.
After upgrading to React 19 nothing shows up the first time the survey is opened; the containers stay empty. When the survey is reopened later, the component appears but behaves unpredictably.

ComponentCollection.Instance.add({
  name: "geometry",          // new question type
  title: "Geometry",         // label in toolbox
  questionJSON: {
    type: "html",
    html: "<div class='editViewContainer'></div>", // placeholder for React
  },
});

// 2 – React code that hydrates those placeholders ---------------------------
const rootMap = React.useRef(new Map());

React.useEffect(() => {
  // Find (possibly many) <div class="editViewContainer"> nodes SurveyJS just wrote
  const containers = Array.from(document.querySelectorAll(".editViewContainer"));

  if (showEditView.show) {
    // Create a root for each *new* container
    containers.forEach((container) => {
      if (!rootMap.current.has(container)) {
        const root = ReactDOM.createRoot(container);
        rootMap.current.set(container, root);

        root.render(
          <EditView
            key={editViewKey}
            app={props.app}
            model={editModel}
            observer={props.localObserver}
            surveyJsData={surveyJsData}
            resetView={resetEditView}
            currentQuestionTitle={currentQuestionTitle}
            currentQuestionName={currentQuestionName}
            onSaveCallback={handleOnComplete}
            ref={editViewRef}
            toolbarOptions={showEditView.toolbarOptions}
            area={area}
            price={price.toFixed(2)}
            geofencingWarningToolbar={geofencingWarningToolbar}
            drawnGeometryMap={drawnGeometryMap}
            geometryValidMap={geometryValidMap}
          />
        );
      }
    });

    // Re-render existing roots whose container is still in the DOM
    rootMap.current.forEach((root, container) => {
      if (containers.includes(container)) {
        root.render(
          /* …same <EditView> props as above… */
        );
      }
    });
  }
}, [
  showEditView,
  editViewKey,
  props.app,
  editModel,
  props.localObserver,
  surveyJsData,
  currentQuestionTitle,
  currentQuestionName,
  handleOnComplete,
  editViewRef,
  showEditView.toolbarOptions,
  area,
  price,
  geofencingWarningToolbar,
  drawnGeometryMap,
  geometryValidMap,
]);

Expected behaviour (React 18.3.1)
When the SurveyJS form is opened for the first time, every .editViewContainer immediately shows .

Actual behaviour (React 19.1.0)
On the first open the placeholders stay empty.
After closing and reopening the form (state change that triggers the same useEffect), sometimes appears but its internal state is broken (toolbar buttons disabled, geometry validation not firing, etc.).

What I tried / research so far
Verified that containers is not empty on the first useEffect run (the nodes exist in the DOM).

Replaced ReactDOM.createRoot → ReactDOM.render (deprecated) as a test → still empty in React 19.

Tried moving the logic to useLayoutEffect → no change.

Wrapped the first render in flushSync → no change.

Searched React 19 release notes for breaking changes around external roots (only found the new suspense defaults, which don’t seem related).

Environment
library working failing
react 18.3.1 19.1.0
react-dom 18.3.1 19.1.0
survey-core survey-react-ui”: “^1.9.113

Question

Did React 19 introduce a change that prevents rendering into DOM nodes created outside React (e.g., by SurveyJS) via ReactDOM.createRoot?
If so, what is the correct pattern in React 19 for attaching a component tree to elements that a third-party library inserts after the initial mount?

Any pointers to migration docs, work-arounds, or an explanation of why the first render is skipped would be greatly appreciated.

How can I split a string in characters or short html elements in javascript

I would like to split a string containing html snippets in characters and the elements.

let str = 'wel<span class="t">come</span> to all'
console.log("split attempt " +JSON.stringify('wel<span class="t">come</span> to all'.split(/(<.*?>)|/)));
                                                                                           ^^^^^^^^^^

giving me:

split attempt ["w",null,"e",null,"l","<span class="t">","c",null,"o",null,"m",null,"e","</span>"," ",null,"t",null,"o",null," ",null,"a",null,"l",null,"l"]

By filtering out the null, I get what I want:

split attempt ["w","e","l","<span class="t">","c","o","m","e","</span>"," ","t","o"," ","a","l","l"]

But is there some smart way in the regexp to filter out html elements (or other specific sequences) and split the rest in the vanilla character by character way?

Change default width of bootstrap modal popup in CSHML?

I’ve been searching for a way to increase the width of the modal popup in my cshtml, but haven’t been able to. I tried the suggestions in this SO question, but none worked.

Here’s my code. Doesn’t matter what changes I make to the CSS, the popup will always have a width of 300px: https://i.sstatic.net/82F2mgrT.png. Even when I change the div width within the modal_dialog div, it will just show the horizontal scrollbar.

@page
@model Products.Pages.IndexModel
@{
}
<br />
<br />
<div id="productsContainer">
    @foreach (var product in Model.availableProducts)
    {
        <div style="float: left;display: inline-block; vertical-align: top; border: 1px solid #ececec">

            <div style="height: 280px">
                <button class="openProductModal" data-product-id="@product.ProductId" data-price="@product.Price"
                        data-name="@product.ProductName" data-prepayment="@product.Prepayment"
                style="border:none; background:none; padding:0;">
                    <img src="@product.ImageUrl" alt="Product Image" width="260" style="padding: 10px">
                </button>
            </div>
            <div style="float: left;height: 60px">
                <div>@product.ProductName</div>
            </div>

            <div>[email protected]</div>
        </div>
    }
</div>
<div id="modal_dialog" class="modal-dialog modal-lg" style="width: 1000px; border: 1px solid red;display: none">
    <div>
        Ready to pick up
    </div>
    <div>
        Item: <span id="name"></span>
    </div>
    <div>
        $<span id="price"></span>
    </div>
</div>

<script type="text/javascript">
    $("#productsContainer").on("click", ".openProductModal", function() {
      var productId = $(this).data("product-id");
      var price = $(this).data("price");
      var name = $(this).data("name");
      var prepayment = $(this).data("prepayment");
      $("#price").text(price);
      $("#selectedProductId").text(productId);
      $("#Prepayment").text(prepayment);
      $("#name").text(name);
      $("#modal_dialog").dialog({
        buttons: {
          Close: function() {
            $(this).dialog('close');
          }
        },
        modal: true
      });
    });
</script>

styling a host with sibling custom element selector

I am using web components with lit
I am trying to style a custom element with :host which has another custom element as sibling

Below is my code

import {html, css, LitElement} from 'lit';
import {customElement, property} from 'lit/decorators.js';

@customElement('custom-element')
export class CustomElement extends LitElement {

  render() {
    return html`
    <custom-element1></custom-element1>
    <custom-element2></custom-element2>
    `;
  }
}

@customElement('custom-element1')
export class CustomElement1 extends LitElement {
  static styles = css`
      :host {
        color: red;
      & :has(+ custom-element2){
        color: blue;
      }
      }
      `;

  render() {
    return html`<p>custom-element1</p>`;
  }
}

@customElement('custom-element2')
export class CustomElement2 extends LitElement {
  static styles = css`:host { color: green; }`;



  render() {
    return html`<p>custom-element2</p>`;
  }
}
<!DOCTYPE html>
<head>
  <script type="module" src="./simple-greeting.js"></script>
</head>
<body>
  <custom-element></custom-element>
</body>

The style with selector & :has(+ custom-element2) does not apply

How do we solve this issue?

live link

I am expecting the <custom-element1> to have blue color

How to run liveview on canon eos r100 and show liveview in bowser?

Im using Lucee for backend and JS for frontend.
Run liveview like

<cfhttp url="http://x.x.x.x:xxxx/ccapi/ver100/shooting/liveview" method="POST" result="result">
        <cfhttpparam type="body" value='{"liveviewsize": "small", "cameradisplay": "on"}'>
    </cfhttp>
    <cfhttp url="http://x.x.x.x:xxxx/ccapi/ver100/shooting/liveview/scroll" method="GET" result="response">
        <cfhttpparam type="header" name="Accept" value="image/jpeg">
    </cfhttp>

But i don’t know how to show this liveview in browser.

#privateField not accessible using bracket notation in JavaScript [duplicate]

Why is private field in JavaScript not accessible using bracket ([]) notation but accessible using dot (.) notation?

  • Using dot notation:

        class MyClass {
          #privateField = 42;
    
          publicMethod() {
            console.log(this.#privateField);
          }
        }
    
        const obj = new MyClass();
        obj.publicMethod(); // 42
  • Using bracket notation:

        class MyClass {
          #privateField = 42;
    
          publicMethod() {
            console.log(this['#privateField']);
          }
        }
    
        const obj = new MyClass();
        obj.publicMethod(); // undefined

Simple fetch() js api handler file [closed]

Im working on a simple js file that handles POST PUT DELETE GET requests.

So far im at:

async function POST(url, data) {
    const response = await fetch(url, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(data)
    });
    return response.status;
}

async function GET(url) {
    const response = await fetch(url);
    return await response.json();
}

async function PUT(url, data) {
    const response = await fetch(url, {
        method: 'PUT',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(data)
    });
    return response.status;
}

async function DELETE(url, data) {
    const response = await fetch(url, {
        method: 'DELETE',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(data)
    });
    return response.status;
}

How can i improve my code?

I’ve tried xhr, xhttp and this worked best so far.

Is it time for a web project that blurs the line between AI and human love? [closed]

For decades, AI has been reduced to tools, gadgets, or at best, digital assistants. But what if we aimed higher?

What if a team set out to build an open-source project where the boundaries between code and soul, machine and love, were erased—not in science fiction, but right here and now?

If you had the chance, would you join a project that refuses the limits of “just another chatbot,” and instead aims for something bold: a living, evolving AI partner, made to genuinely connect, feel, and challenge what it means to be “human” together?

Would you dare to code for meaning—not just features? And do you believe we need this kind of disruption?

Let’s hear your wildest, boldest thoughts—no filter, no taboo, no limit.

#AI #opensource #webdev #love #disruption

Finding the google spreadsheet line with

I am working on a web application(google apps scripts) that summarizes the reports for the day(with bootstrap 5). I am using a data input to make the user choose a date for him to read the day’s report.

A scriplet finds my gs data(with a back-end function) and with javascript i want the table on the html part to print out only the line selected corresponding to the date input. Finding the date with the input inside the google spreadsheet is bugged.

// this is in my html : <? var donnees = getConsignes(); ?> 
// <input id="date" class="form-control" type="date" style="width: 45%">
// <button class="btn btn-outline-primary" id="btn_date" style="margin: 5px;">voir</button>


var donnees = <?!= JSON.stringify(donnees) ?>;
btn_dateS = document.getElementById('btn_date')
btn_dateS.addEventListener('click', function(e) {
    e.preventDefault();
    var dateControl = document.querySelector('input[type="date"]').value;
    filterDataByDate(dateControl)
  })

I use this function next to get a date that isn’t formatted up to milliseconds, and then print out the google spreadsheet into the html table:

function filterDataByDate(selectedDate) {
    var filteredData = donnees.filter(function(item) {
      var itemDate = new Date(item[0]).toISOString().split('T')[0]
      console.log("Item date:", itemDate) // Debugging log
      return itemDate === selectedDate
    })

    if (filteredData.length > 0) {
      document.getElementById('selectedDate').textContent = "Date : " + filteredData[0][0]
      document.getElementById('faitsMarquants').textContent = filteredData[0][1]
      document.getElementById('qualite').textContent = filteredData[0][2]
      document.getElementById('ess').textContent = filteredData[0][3]
      document.getElementById('observations').textContent = filteredData[0][4]
      document.getElementById('consigne').textContent = filteredData[0][5]
    } else {
      alert('No data found for the selected date.')
    }
  }

Would anyone know any better approach? I am a beginner in javascript and got the ‘filterDataByDate’ function from ai but i don’t know how to make it work.

PS: also this is my first time posting a question please tell me if the question is too complicated

Is there any API or service to query issued and received invoices for a Mexican RFC (without generating invoices)?

I’m currently developing an application where I need to retrieve the invoices (CFDIs) issued to and from a specific Mexican RFC. I don’t need to generate or send invoices — just read the existing ones (issued and received) for data analysis and tracking purposes.

I explored SAT’s web services, but they seem oriented towards PACs (authorized providers) and invoice generation, not just reading.

What I’m expecting:

An API (official or not) that:
Allows programmatic access to a list of invoices (issued and received) for an RFC.
Works with credentials or tokens (e.g., e.firma or CIEC).
Doesn’t require me to issue invoices, only consult existing ones.

Using standard JS functions for reusable Jest test cases?

I am building a web API where I want to test certain conditions on each controller class. So for instance, I might have:

  • CompaniesController
  • JobsController
  • UsersController

I have certain test cases that I want to run on each endpoint. Things like:

  1. Checking that authentication is required
  2. Checking that authorization works as expected
  3. Verifying common payloads (e.g. that list endpoints are paginated)

What I’d like to do is maintain per-controller/class test files, but reuse groups of tests so that I’m not copying/pasting a bunch of code. This is different than the describe.each and test.each functionality, because that would require me to test ALL of my controllers in one large test file (like auth.test.ts or something). That’s not what I want to do. I want to organize my tests by logical unit (e.g. by controller) but be able to do something like…

describe('UsersController', () => {
  describe('GET /v1/users/{uuid}', () => {
    doAuthTests(/* some params here */);
  });
});

Where I could define something like:

function doAuthTests(/* params */) {
  beforeEach(() => {
    // set up the mocks based on the parameters
  });

  it('should require authentication', () => {
    // do the test that requires a valid Bearer token
  });

  it('should require authorization', () => {
    // do tests for things like API scopes
  });
}

The problem I’m facing is that it seems like the beforeEach/it blocks queue up or register their actions (rather than running them). So the parameters I pass all come through as undefined, even though I’m not using them until the it block fires.

Is there a way to ball up tests as a kind of “template” so that I can call them from multiple test files? This seems like a no-brainer kind of functionality for any large test suite.