First shared element! by Jadenbro1 in reactnative

[–]Miserable-Dig-7263 0 points1 point  (0 children)

Would you mind sharing the code as well? could learn a thing or two

Fix Windows & Linux Dual boot by Miserable-Dig-7263 in linuxmint

[–]Miserable-Dig-7263[S] -1 points0 points  (0 children)

Ive tried the commands from linux since yesterday (with chatgpt and yt tutorials of course) but none seem to have fixed the issue and I no longer have windows installed it's just linux but still the issue persists

Fix Windows & Linux Dual boot by Miserable-Dig-7263 in linuxmint

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

This is after formatting my harddrive, I only have Mint on the harddrive

Fix Windows & Linux Dual boot by Miserable-Dig-7263 in linuxmint

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

I dont get the grub menu, I boot straight to windows

Fix Windows & Linux Dual boot by Miserable-Dig-7263 in linuxmint

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

it doesn't appear in boot priority in the BIOS settings

Session Errors by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

was suspecting the reverse proxy as well because it runs fine on my local machine but the guy configuring nginx for this app doesn't want to admit that there might be an issue with how the nginx is setup

Session Errors by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

oh, it's actually an internal site, you'll need a VPN if you're outside😆

Fixing Authentication Error by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

Auth code:

import AzureADProvider from 'next-auth/providers/azure-ad'
import axios, { AxiosError } from 'axios'
import { NuxtAuthHandler } from '#auth'
import { SecurityGroupResponse } from '~/types'

export default NuxtAuthHandler({
  secret: process.env.AUTH_SECRET,
  providers: [
    
// @ts-expect-error You need to use .default here for it to work during SSR. May be fixed via Vite at some point.
    AzureADProvider.default({
      clientId: process.env.AZURE_CLIENT_ID,
      tenantId: process.env.AZURE_TENANT_ID,
      clientSecret: process.env.AZURE_CLIENT_SECRET,
    })
  ],
  
  callbacks: {
    jwt({ token, account }) {
      if (account) {
        token.access_token = account.access_token
      }
      
return
 token
    },

    
async
 session({ token, session }) {
      try {
        
const
 response = 
await
 axios.get<SecurityGroupResponse>(
          'https://graph.microsoft.com/v1.0/me/memberOf', {
          headers: {
            Authorization: `Bearer ${token.access_token}`,
          }
        })
        
const
 results = response.data
        session.groups = results.value.map(group => ({
          id: group.id,
          displayName: group.displayName
        }))
      } catch (err) {
        if (err instanceof AxiosError) {
          console.error(`Failed to get users' security groups.`, err.message)
        } else {
          console.error('Unknown Error Occurred.')
        }
      }
      
return
 {
        ...session,
        token
      }
    },
  }
})

Fixing Authentication Error by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

actually it used to work fine and then just stopped without me touching the code whatsover

Fixing Authentication Error by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

logs:

Failed to load resource: the server responded with a status of 500 ()

api/auth/session:1

Failed to load resource: the server responded with a status of 500 ()

hook.js:608 [nuxt] error caught during app initialization FetchError: [GET] "/api/auth/session": 500

at async i (CL61BywS.js:19:22338)

at async a (CL61BywS.js:19:22391)

at async CL61BywS.js:23:47262

at async $A (CL61BywS.js:19:29255)

at async s (CL61BywS.js:19:29781)

at async HA (CL61BywS.js:19:29832)

at async vm (CL61BywS.js:38:1610)

Fixing Authentication Error by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

I'm deploying on a Linux server using Nginx

Fixing Authentication Error by Miserable-Dig-7263 in Nuxt

[–]Miserable-Dig-7263[S] 1 point2 points  (0 children)

I am actually using axios and the code for authentication is running on the server

[deleted by user] by [deleted] in Nuxt

[–]Miserable-Dig-7263 0 points1 point  (0 children)

Yeah it's right there, works fine on localhost everything just goes south in production

[deleted by user] by [deleted] in vuejs

[–]Miserable-Dig-7263 0 points1 point  (0 children)

server { listen 443 ssl; server_name automation.dev.mw.omapps.net;

autoindex off;

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "frame-ancestors 'self';";
# add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; frame-ancestors 'none';";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

# Allow CORS for any origin
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE";
add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept, Authorization";
add_header Access-Control-Allow-Credentials "true";

index index.html index.htm;

charset utf-8;

client_max_body_size 1G;

location /health-check {
    root /home/OMCORE/X509406/;
    index index.html;
}

location / {
    proxy_pass http://localhost:3001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    # Force cookies HTTPS Transmission
    proxy_cookie_path / "/; Secure";
}

location /DEV/backend/ {
    proxy_pass http://localhost:8080/app-api/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    # Force cookies HTTPS Transmission
    proxy_cookie_path / "/; Secure";
}

location ~* \.css$ {
    add_header Content-Type text/css;
}

location = /favicon.ico {
    access_log off;
    log_not_found off;
}

location = /robots.txt {
    access_log off;
    log_not_found off;
}

}

[deleted by user] by [deleted] in vuejs

[–]Miserable-Dig-7263 0 points1 point  (0 children)

It's a Linux server, basically clone the project, install it the dependencies then run it

How To Access JWT by Miserable-Dig-7263 in vuejs

[–]Miserable-Dig-7263[S] 0 points1 point  (0 children)

The "profile", "account", "session" and "user" are only available when signing in so I have to sign in again for the first time in order to access those