<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cress</title>
    <description>The latest articles on DEV Community by Cress (@cress).</description>
    <link>https://dev.to/cress</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1085945%2Fdd723943-a985-4526-a4e9-1f34b1c0836f.png</url>
      <title>DEV Community: Cress</title>
      <link>https://dev.to/cress</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cress"/>
    <language>en</language>
    <item>
      <title>I'm going to buy an Oracle license when this war is over.</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Tue, 29 Jul 2025 15:34:40 +0000</pubDate>
      <link>https://dev.to/cress/im-going-to-buy-an-oracle-license-when-this-war-is-over-5c5h</link>
      <guid>https://dev.to/cress/im-going-to-buy-an-oracle-license-when-this-war-is-over-5c5h</guid>
      <description>&lt;p&gt;I tried to buy an Oracle license but couldn't. Because the system we are developing has users in Russia office.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.oracle.com/jp/corporate/security-practices/corporate/governance/global-trade-compliance.html" rel="noopener noreferrer"&gt;https://www.oracle.com/jp/corporate/security-practices/corporate/governance/global-trade-compliance.html&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Any company or national of Cuba, Iran, North Korea, Syria, and the Crimea region, Ukraine's Donbas and other Russian controlled areas of Ukraine as they exist in fact, Belarus*, Russia* and Venezuela*. Export licensing of commodities or services intended for these countries is presumed denied;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is not only Oracle but also the other products from the United States.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That means we can't cut over our system unless Russia stops their war.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will be forced to make difficult decision, such as making our system not to be used Russia users, or quitting our all projects.&lt;/p&gt;

&lt;p&gt;A few fools are giving us a lot of trouble.&lt;/p&gt;

&lt;p&gt;What's wrong with being against the war?&lt;/p&gt;

</description>
      <category>oracle</category>
    </item>
    <item>
      <title>What I have become able to do by studying English</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Wed, 14 Aug 2024 12:25:33 +0000</pubDate>
      <link>https://dev.to/cress/what-i-had-become-able-to-do-by-studying-english-11kc</link>
      <guid>https://dev.to/cress/what-i-had-become-able-to-do-by-studying-english-11kc</guid>
      <description>&lt;p&gt;I had studied English at foreign insurance company for 1 year since April 2023. My colleagues at that time came from various countries, such as China, France, and India.&lt;/p&gt;

&lt;p&gt;What I have become able to do are following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request for restarting application servers&lt;/li&gt;
&lt;li&gt;Request for retrieving a log file and putting it into the shared file server&lt;/li&gt;
&lt;li&gt;Writing email for my resignation announcement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, I have become a banker since April 2024. I have communicated with EMEA, Americas, and APAC in English.&lt;/p&gt;

&lt;p&gt;What I have become able to do additionally are following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request for filling out for a network usage application&lt;/li&gt;
&lt;li&gt;Response for inquiries regarding system usage from foreign offices&lt;/li&gt;
&lt;li&gt;Apology for delay in sharing project overview&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I still can't have daily conversations.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Announcement</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 29 Jun 2024 05:16:38 +0000</pubDate>
      <link>https://dev.to/cress/announcement-1ibe</link>
      <guid>https://dev.to/cress/announcement-1ibe</guid>
      <description>&lt;p&gt;I graduate from my business for June on the last business day of June. I would like to appreciate for my supporters and apologize for my unsatisfactory results.&lt;/p&gt;

&lt;p&gt;It was only a short period of 20 business days since I started business on 3rd June and terminated on 28th. Although I have learned the business for June and have many opportunities in the future, I am also very disappointed that the last business day has come.&lt;/p&gt;

&lt;p&gt;By the way, July comes soon. I will do my best using my experience of June.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Graduation from senior engineer</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Thu, 07 Mar 2024 16:10:38 +0000</pubDate>
      <link>https://dev.to/cress/graduation-from-senior-engineer-84o</link>
      <guid>https://dev.to/cress/graduation-from-senior-engineer-84o</guid>
      <description>&lt;p&gt;I will graduate from senior engineer at the end of this month.&lt;br&gt;
From next month, I will become a banker at a Japanese famous mega bank.&lt;/p&gt;

&lt;p&gt;My technical field was open technologies such as Java, Oracle, and Linux. I have been involved in IT system development for life insurance business for 14 years. I could gain experiences of IT and finance.&lt;/p&gt;

&lt;p&gt;Additionally, I have studied English very hard since last year. Because I could not talk about business with my colleagues without English. My business was widen because of English, and I could know that there are many more talented engineers in the world.&lt;/p&gt;

&lt;p&gt;Now I will be involved in international information systems for the mega bank. Although I will become not to make programs by myself, I will improve information systems by different approach.&lt;/p&gt;

&lt;p&gt;I will graduate from senior engineer soon.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>My purpose of studying foreign languages</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Mon, 21 Aug 2023 06:43:43 +0000</pubDate>
      <link>https://dev.to/cress/my-purpose-of-studying-foreign-languages-3j3p</link>
      <guid>https://dev.to/cress/my-purpose-of-studying-foreign-languages-3j3p</guid>
      <description>&lt;p&gt;One of my colleagues is a young engineer from France. He is so talented that he will become an executive. When he becomes an executive, he should take us to an exclusive Japanese restaurant. For that day, I must study French as well as English.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Create a web application for a small business by Next.js with Slack authentication</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 27 May 2023 11:56:54 +0000</pubDate>
      <link>https://dev.to/cress/create-a-web-application-for-a-small-business-by-nextjs-with-slack-authentication-23l3</link>
      <guid>https://dev.to/cress/create-a-web-application-for-a-small-business-by-nextjs-with-slack-authentication-23l3</guid>
      <description>&lt;p&gt;Creating a web application, it is hard work that implementing a login authentication. Login authentication, reissuance forgotten password, password change and etc. are required. But using NextAuth.js and Slack, you don't need for preparing these yourself. It is very easy and recommended for small businesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create LOCAL server with HTTPS enabled
&lt;/h2&gt;

&lt;p&gt;Slack requires that the application URL uses HTTPS, even for local development. In this case, local-ssl-proxy is easy and useful.&lt;/p&gt;

&lt;p&gt;See also:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6"&gt;https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure on Slack side
&lt;/h2&gt;

&lt;p&gt;Follow quickstart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://api.slack.com/authentication/quickstart"&gt;https://api.slack.com/authentication/quickstart&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a client ID and a client secret
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click "Create a new Slack app" button.&lt;/li&gt;
&lt;li&gt;In "Your Apps" page, click "Create New App" and choose "From scratch"&lt;/li&gt;
&lt;li&gt;Enter your app name and pick a workspace to develop your app in.&lt;/li&gt;
&lt;li&gt;Click "Create App" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then, in "App Credentials" section of "Basic Information" page, you can see its client ID and client secret.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure a redirect URL
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In "Add features and functionality" section of "Basic Information" page, click "Permissions".&lt;/li&gt;
&lt;li&gt;In Redirect URLs of "OAuth &amp;amp; Permissions" page, click "Add New Redirect URL" button.&lt;/li&gt;
&lt;li&gt;Enter "&lt;a href="https://localhost:3001"&gt;https://localhost:3001&lt;/a&gt;" and click "Add" button.&lt;/li&gt;
&lt;li&gt;Click "Save URLs" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then you can use authentication by Slack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create your application
&lt;/h2&gt;

&lt;p&gt;See also:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://next-auth.js.org/"&gt;https://next-auth.js.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an example, create application named &lt;em&gt;slack-auth-example&lt;/em&gt; by &lt;code&gt;create-next-app&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;create-next-app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;slack-auth-example&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, install packages from npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;next-auth&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bootstrap&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;react-bootstrap&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  .env.development.local
&lt;/h3&gt;

&lt;p&gt;Put information depending your environment into &lt;code&gt;.env.development.local&lt;/code&gt; file as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;SLACK_CLIENT_ID&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;Your client ID&amp;gt;"&lt;/span&gt;
&lt;span class="py"&gt;SLACK_CLIENT_SECRET&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;Your client secret&amp;gt;"&lt;/span&gt;
&lt;span class="py"&gt;NEXTAUTH_URL&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://localhost:3001"&lt;/span&gt;
&lt;span class="py"&gt;NEXTAUTH_SECRET&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"changeit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Values for &lt;code&gt;SLACK_CLIENT_ID&lt;/code&gt; and &lt;code&gt;SLACK_CLIENT_SECRET&lt;/code&gt; are what you get in "Create a client ID and a client secret" section.&lt;/p&gt;

&lt;h3&gt;
  
  
  /api/auth/[...nextauth].ts
&lt;/h3&gt;

&lt;p&gt;This is the minimal configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;NextAuth&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next-auth/next&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;SlackProvider&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next-auth/providers/slack&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;authOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;SlackProvider&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SLACK_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SLACK_CLIENT_SECRET&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;NextAuth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;authOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  pages/_app.tsx
&lt;/h3&gt;

&lt;p&gt;Surround Component with SessionProvider.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/styles/globals.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;SessionProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-auth/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next/app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;pageProps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;AppProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SessionProvider&lt;/span&gt; &lt;span class="na"&gt;session&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;SessionProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example: index.tsx
&lt;/h3&gt;

&lt;p&gt;It shows login button. As you logged in, it shows your name and logout button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;signOut&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useSession&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next-auth/react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-bootstrap&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bootstrap/dist/css/bootstrap.min.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useSession&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;loading&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;authenticated&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;You are logged in as &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;signOut&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Logout&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slack&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Login&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Integration with Prisma
&lt;/h2&gt;

&lt;p&gt;NextAuth.js has an adapter for using Prisma. Sessions can be managed in databases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://authjs.dev/reference/adapter/prisma"&gt;https://authjs.dev/reference/adapter/prisma&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;next-auth&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="nx"&gt;prisma/client&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="nx"&gt;next-auth/prisma-adapter&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-D&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Prisma setup
&lt;/h3&gt;

&lt;p&gt;An example using MySQL is shown.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--datasource-provider&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mysql&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, edit &lt;code&gt;prisma.schema&lt;/code&gt; file as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mys"
  url      = env("DATABASE_URL")
}

model Account {
  id                 String  @id @default(cuid())
  userId             String
  type               String
  provider           String
  providerAccountId  String
  ok                 Boolean?
  refresh_token      String?  @db.Text
  access_token       String?  @db.Text
  expires_at         Int?
  token_type         String?
  scope              String?
  id_token           String?  @db.Text
  state              String?
  session_state      String?

  user User @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([provider, providerAccountId])
}

model Session {
  id           String   @id @default(cuid())
  sessionToken String   @unique
  userId       String
  expires      DateTime
  user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model User {
  id            String    @id @default(cuid())
  name          String?
  email         String?   @unique
  emailVerified DateTime?
  image         String?
  accounts      Account[]
  sessions      Session[]
}

model VerificationToken {
  identifier String
  token      String   @unique
  expires    DateTime

  @@unique([identifier, token])
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit following line in &lt;code&gt;.env.development.local&lt;/code&gt; file according to your environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"mysql://johndoe:randompassword@localhost:3306/mydb"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run a command as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;generate&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Prisma client has been generated.&lt;/p&gt;

&lt;h3&gt;
  
  
  /api/auth/[...nextauth].ts
&lt;/h3&gt;

&lt;p&gt;Add &lt;code&gt;adapter&lt;/code&gt; property to &lt;code&gt;authOptions&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaAdapter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@next-auth/prisma-adapter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@prisma/client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;NextAuth&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next-auth/next&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;SlackProvider&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next-auth/providers/slack&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;authOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PrismaAdapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;SlackProvider&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SLACK_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SLACK_CLIENT_SECRET&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;NextAuth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;authOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Initialize database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;migrate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;dev&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  For your information
&lt;/h2&gt;

&lt;p&gt;Don't worry that outsiders can't log in even if they have an other domain Slack account. Because the client ID you got is tied to your Slack domain, only your Slack domain member can log in. It is not always necessary to hold user information in your database.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>node</category>
      <category>slack</category>
    </item>
    <item>
      <title>When you need HTTPS on LOCAL environment, local-ssl-proxy is the best solution</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Mon, 22 May 2023 03:15:09 +0000</pubDate>
      <link>https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6</link>
      <guid>https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6</guid>
      <description>&lt;p&gt;Implementing single-sign-on (SSO) with nextauth.js and Slack, LOCAL environment also needs HTTPS support. In this case, it is very easy and useful that using local-ssl-proxy like a reverse proxy server.&lt;/p&gt;

&lt;p&gt;This article is for Windows PC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing local-ssl-proxy
&lt;/h2&gt;

&lt;p&gt;Local-ssl-proxy only supports global installation. Install as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;local-ssl-proxy&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An example usage is below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;local-ssl-proxy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3001&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--target&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3000&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, an application is running on port 3000. Run local-ssl-proxy on port 3001 targeting for port 3000.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cameronhunter/local-ssl-proxy"&gt;https://github.com/cameronhunter/local-ssl-proxy&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  It works but SSL warnings
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;You'll get a warning because the certificate is self-signed, this is safe to ignore during development.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Create an effective certificate using mkcert.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing scoop
&lt;/h3&gt;

&lt;p&gt;On Windows, it is very easy that installing mkcert using scoop. Following the quickstart, run as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;RemoteSigned&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;CurrentUser&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;irm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;get.scoop.sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://scoop.sh/"&gt;https://scoop.sh/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing mkcert
&lt;/h3&gt;

&lt;p&gt;Mkcert is the best solution for creating certificates on Windows. It is easier than installing OpenSSL and others as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;scoop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;extras&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;scoop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mkcert&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installation should be failed without Git. Install Git first if you don’t have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/FiloSottile/mkcert"&gt;https://github.com/FiloSottile/mkcert&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Running mkcert
&lt;/h3&gt;

&lt;p&gt;Create a local certificates authority (CA). The following command must be run as administrator privilege. If you have run as not administrator privilege, redo with running &lt;code&gt;mkcert -uninstall&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;mkcert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-install&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, create a key and a certificate for localhost as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;mkcert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;localhost&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should have gotten &lt;code&gt;localhost-key.pem&lt;/code&gt; and &lt;code&gt;localhost.pem&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running local-ssl-proxy with the certificate enabled
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;local-ssl-proxy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;localhost-key.pem&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--cert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;localhost.pem&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3001&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--target&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3000&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running local-ssl-proxy every time is exhausting
&lt;/h2&gt;

&lt;p&gt;Npm-run-all is the best solution. It can run multiple commands for serial or parallel. Install as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-D&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;npm-run-all&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, change package.json as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* package.json */&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;npm-run-all -p dev:*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dev:app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next dev&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dev:ssl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;local-ssl-proxy --key localhost-key.pem --cert localhost.pem --source 3001 --target 3000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="cm"&gt;/* snipped */&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="cm"&gt;/* snipped */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running &lt;code&gt;npm run dev&lt;/code&gt;, commands matching with &lt;code&gt;dev:*&lt;/code&gt; will be run for parallel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/npm-run-all"&gt;https://www.npmjs.com/package/npm-run-all&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Wildcard not expanded on powershell</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sun, 21 May 2023 18:33:13 +0000</pubDate>
      <link>https://dev.to/cress/wildcard-not-expanded-on-powershell-16cm</link>
      <guid>https://dev.to/cress/wildcard-not-expanded-on-powershell-16cm</guid>
      <description>&lt;h2&gt;
  
  
  What we want to do
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;python myapp.py folder/*.txt&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Correct usage
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;python myapp.py (Get-Item folder/*.txt)&lt;/code&gt;&lt;/p&gt;

</description>
      <category>powershel</category>
    </item>
    <item>
      <title>ORA-28000: the account is locked</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 20 May 2023 03:48:18 +0000</pubDate>
      <link>https://dev.to/cress/ora-28000-the-account-is-locked-l6d</link>
      <guid>https://dev.to/cress/ora-28000-the-account-is-locked-l6d</guid>
      <description>&lt;h2&gt;
  
  
  Who locked oracle database account?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If you have any idea, let me know right now!&lt;/strong&gt;&lt;br&gt;
But no one does, so we need to find out who locked it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Survey method
&lt;/h2&gt;

&lt;p&gt;For windows, you can find the error logs on Event Viewer. For Linux and others, on the Oracle alert logs. Its location is below:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$ORACLE_BASE/diag/rdbms/&amp;lt;SID&amp;gt;/&amp;lt;SID&amp;gt;/trace/alert_&amp;lt;SID&amp;gt;.log&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;First, find the line "ORA-28000: the account is locked". Then, find the line "ORA-01017: invalid username/password; logon denied" just before it. Because the most likely cause is wrong password.&lt;br&gt;
You can find the source host name printed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shout the source host name
&lt;/h2&gt;

&lt;p&gt;That is the culprit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Corrective action
&lt;/h2&gt;

&lt;p&gt;Make sure all members understand the above steps and that no one can escape from administrator.&lt;/p&gt;

</description>
      <category>oracle</category>
    </item>
    <item>
      <title>For English studying...</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 20 May 2023 02:55:36 +0000</pubDate>
      <link>https://dev.to/cress/for-english-studying-ec3</link>
      <guid>https://dev.to/cress/for-english-studying-ec3</guid>
      <description>&lt;p&gt;My new boss is a man from France.&lt;br&gt;
Body language doesn't work to him.&lt;br&gt;
I should study English again.&lt;/p&gt;

&lt;p&gt;The above is a part of a famous song in Japan.&lt;/p&gt;

&lt;p&gt;I am publishing a tech blog in Japanese, following:&lt;br&gt;
&lt;a href="https://qiita.com/cress_cc"&gt;https://qiita.com/cress_cc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But there is not enough tech information in Japanese, and so is English.&lt;br&gt;
Therefore, I'll write tech articles while studying English.&lt;/p&gt;

&lt;p&gt;Sorry for my poor English, and thank you for reading.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
  </channel>
</rss>
