Trying to connect nextjs application with Rails API, after signing in getting this error:
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to