Skip to content
Snippets Groups Projects
Select Git revision
  • a1d46dca3ff89ddc32219beaaa9f78a6edd38f36
  • master default protected
  • ajout_ppa_rsa_budgetaire
  • 365-ouvrir-l-onglet-employeur-ou-taxes-carburant-quand-c-est-le-cas-pour-un-dispositif
  • 381-pb-affichage-labels-des-parametres-sur-plus-de-3-lignes
  • ajoute-duplicate-aide-logement
  • poc_castype_ia
  • parametres-editables-budget
  • ui-parametres
  • 366-signe-a-cote-du-droit-en-vigueur-sur-l-ui-pour-indiquer-que-la-reforme-a-eu-lieu-mais-qu-elle-n
  • 355-les-dispositifs-prestations-sociales-du-graphique-se-cachent-montrent-en-meme-temps-2
  • 358-les-variables-dont-le-montant-est-nul-apparaissent-en-bleu-et-non-cliquables
  • 356-ajuster-la-largeur-sur-les-graphiques-budgetaires
  • incoherence_cas_type_0
  • fix-ui-suppression-tranches-baremes
  • ajout-agregat-cehr-version-plf
  • impact_carbone
  • xlsx
  • header_revamp
  • 270-concevoir-la-page-d-accueil-leximpact
  • 219-conversion-des-montants-min-et-max-de-l-axe-des-x-en-smic
  • 0.0.1123
  • 0.0.1122
  • 0.0.1121
  • 0.0.1120
  • 0.0.1119
  • 0.0.1118
  • 0.0.1117
  • 0.0.1116
  • 0.0.1115
  • 0.0.1114
  • 0.0.1113
  • 0.0.1112
  • 0.0.1111
  • 0.0.1110
  • 0.0.1109
  • 0.0.1108
  • 0.0.1107
  • 0.0.1106
  • 0.0.1105
  • 0.0.1104
41 results

openid_connect_handler.ts

Blame
  • openid_connect_handler.ts 757 B
    import type { Handle } from "@sveltejs/kit"
    import { Configuration, discovery } from "openid-client"
    
    import serverConfig from "$lib/server/server_config"
    
    export interface OpenIdConnectLocals {
      openIdConnectConfiguration?: Configuration
    }
    
    const { openIdConnect } = serverConfig
    
    export const openIdConnectHandler: Handle = async ({ event, resolve }) => {
      if (openIdConnect !== undefined) {
        if (event.locals.openIdConnectConfiguration === undefined) {
          event.locals.openIdConnectConfiguration = await discovery(
            new URL(openIdConnect.issuerUrl),
            openIdConnect.clientId,
            openIdConnect.clientSecret,
          )
          event.locals.openIdConnectConfiguration.timeout = 10000 // 10 s
        }
      }
    
      return await resolve(event)
    }