mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-26 02:23:21 +03:00
Fixes template issue with new OAuth impl (#1901)
This commit is contained in:
parent
72ebdb8d8c
commit
ea247dc4fc
@ -1,6 +1,8 @@
|
||||
{{={= =}=}}
|
||||
import { Router } from "express";
|
||||
{=# isExternalAuthEnabled =}
|
||||
import { setupOneTimeCodeRoute } from "./oauth/oneTimeCode";
|
||||
{=/ isExternalAuthEnabled =}
|
||||
|
||||
{=# providers =}
|
||||
{=& importStatement =}
|
||||
@ -14,9 +16,11 @@ const providers = [
|
||||
|
||||
const router = Router();
|
||||
|
||||
{=# isExternalAuthEnabled =}
|
||||
// Setting up a common route for all OAuth providers to exchange
|
||||
// one-time code for a session.
|
||||
setupOneTimeCodeRoute(router);
|
||||
{=/ isExternalAuthEnabled =}
|
||||
|
||||
for (const provider of providers) {
|
||||
const { createRouter } = provider;
|
||||
|
@ -71,7 +71,11 @@ genAuthRoutesIndex auth = return $ C.mkTmplFdWithDstAndData tmplFile dstFile (Ju
|
||||
genProvidersIndex :: AS.Auth.Auth -> Generator FileDraft
|
||||
genProvidersIndex auth = return $ C.mkTmplFdWithData [relfile|src/auth/providers/index.ts|] (Just tmplData)
|
||||
where
|
||||
tmplData = object ["providers" .= providers]
|
||||
tmplData =
|
||||
object
|
||||
[ "providers" .= providers,
|
||||
"isExternalAuthEnabled" .= AS.Auth.isExternalAuthEnabled auth
|
||||
]
|
||||
|
||||
providers =
|
||||
makeConfigImportJson
|
||||
|
Loading…
Reference in New Issue
Block a user