Frontend – open all notebooks in working mode?

Is there a way to set this as a global setting that goes beyond a single setting of the notebook screen environment?

Motivation: I have a folder with many slideshows and I have to change it manually each time I open it.

What I tried: Setting the ScreenStyleEnvironment in the Options inspector does not work globally for notebooks that you have not yet opened:

Enter image description here

I can not authorize my front-end .Net Core app

Hope you're all fine.

I'm stuck with this very strange problem. Maybe I am new to this area or know little about it. Let me first explain the process of the problem.

  1. Web API project with .NET Core
  2. Call the API via the Refit SDK.
  3. 3. Calling these APIs from .Net Core Razor Pages front-end (separate project.)

The JWT owner token is used for this.

Below is the startup file code for the API project.

services.AddMvc(options =>
                {
                    options.EnableEndpointRouting = false;
                    options.Filters.Add();
                })
                .AddFluentValidation(mvcConfiguration => mvcConfiguration.RegisterValidatorsFromAssemblyContaining())
                ;

            var jwtSettings = new JwtSettings();
            configuration.Bind(nameof(jwtSettings), jwtSettings);
            services.AddSingleton(jwtSettings);

            var tokenValidationParameters = new TokenValidationParameters
            {
                ValidateIssuerSigningKey = true,
                IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(jwtSettings.Secret)),
                ValidateIssuer = false,
                ValidateAudience = false,
                RequireExpirationTime = false,
                ValidateLifetime = true
            };

            services.AddSingleton(tokenValidationParameters);

            services.AddAuthentication(x =>
                {
                    x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                    x.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
                    x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                })
                .AddJwtBearer(x =>
                {
                    x.SaveToken = true;
                    x.TokenValidationParameters = tokenValidationParameters;
                });

            services.AddAuthorization(options =>
            {
                options.AddPolicy("MustWorkForChapsas", policy =>
                    {
                        policy.AddRequirements(new WorksForCompanyRequirement("chapsas.com"));
                    });
            });

            services.AddSingleton();

So I use Authorize in my API controllers.

 (Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme))
    (ApiExplorerSettings(GroupName = "V1"))
    public class FaqsController : ControllerBase
    {
        protected readonly ILogger _logger;
        private readonly IFaqService _faqService;
        private readonly IMapper _mapper;
        private readonly IUriService _uriService;

So I create my SKD with refit.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EdgeTours.API.Contracts.V1.Requests;
using EdgeTours.API.Contracts.V1.Requests.Queries;
using EdgeTours.API.Contracts.V1.Responses;
using EdgeTours.Model.CommonViewModels;
using Refit;

namespace EdgeTours.API.Sdk.V1
{
    (Headers("Authorization: Bearer"))
    public interface IFaqApi
    {
        (Get("/api/v1/faqs"))
        Task>> GetAllAsync(string FaqId = null, int? PageNumber = 1, int? PageSize = 100);

Everything works fine and even if I try to access this API through the browser without owner tokens, I get the error 401. Enter image description here

Even APIs work well from the frontend project.

Here is the code for the startup file of the frontend project.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using EdgeTours.Repository.Context;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using System.Net;

namespace EdgeTours.Web
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseAuthentication();

            app.UseMvc();
        }
    }
}

So the problem is that.

I can not redirect to the login page because no authorization is enabled. Therefore, I would be very happy to have someone help me configure my razor pages class and startup file to enable authentication if the API call is invalid to the login page.

I would be very happy if someone helped me. Thank you in advance.

Java form validation code shared in the frontend and backend APIs?

I have an old monolithic Java web application. My goal is to use React on the frontend, leave Java on the backend, and add an API for the frontend.

My question is, how can I write the data validation only once and use it both in the form validation frontend and in the backend for data validation?

With the API written in Java and data validation written in JavaScript, is it a viable solution to write a proxy API for intermediate validation in JavaScript + NodeJS that then forwards validated requests to the Java API?

Respond (js validation) -> Nodejs API (js validation) -> Java API (no data validation)

ajax – Update the frontend view without updating

I was wondering how you could update the WordPress homepage with new content or CSS without the user updating it.

I have a interface (unlike normal WordPress installations), which is just a viewer window and does not involve any user interaction – like a bulletin board.

I've tried using WordPress Heartbeat, but since the last update, it has stopped working and sent a wrong JSON output.

Is there a way to get or query the SQL database from jquery to compare changes and update the front end?

This would not be constant, but would save updating the UI every x seconds.

magento2 – Store View in Magento 2 Frontend

I'm creating a website with Magento 2 along with an app. The app offers the possibility to change the language in English and Arabic. However, I'm trying to make the frontend for adding a product on the site look like magento 2 admin. There we can edit the product in Arabic. Likewise, I would like to add the same attribute so that someone who advertises a product through the frontend can add it in Arabic.