-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from intri-in/nextAuth
v0.3.0-dev
- Loading branch information
Showing
106 changed files
with
2,773 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
env: process.env.NODE_ENV, | ||
'config': path.resolve('config', 'config.js'), | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
admin/getusers API Changes | ||
- Added dev dependencies to make cypress work. | ||
- Added eslint dependencies | ||
v0.3.0-dev | ||
- Version bumped to 0.3.0 | ||
- NextAuth.js Introduced | ||
- OAuth now works with MMDL! | ||
- Supports Keycloak, Google, Authentik out of the box. The rest (those supported by NextAuth.js) can be added manually by the user. | ||
- Sequelize formally introduced | ||
- Models and migrations generated | ||
- Bug fixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const dotenv = require('dotenv') | ||
dotenv.config({ path: `.env.local`, override: true }); | ||
module.exports = { | ||
local: { | ||
username: process.env.DB_USER, | ||
password: process.env.DB_PASS, | ||
database: process.env.DB_NAME, | ||
host: process.env.DB_HOST, | ||
port: 3306, | ||
dialect: "mysql" | ||
}, | ||
test: { | ||
username: "root", | ||
password: null, | ||
database: "database_test", | ||
host: "127.0.0.1", | ||
dialect: "mysql" | ||
}, | ||
production: { | ||
username: "root", | ||
password: null, | ||
database: "database_production", | ||
host: "127.0.0.1", | ||
dialect: "mysql" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import KeycloakProvider from "next-auth/providers/keycloak"; | ||
import GoogleProvider from 'next-auth/providers/google' | ||
import AuthentikProvider from 'next-auth/providers/authentik' | ||
import { varNotEmpty } from "@/helpers/general"; | ||
|
||
/** | ||
* Array of authProviders that will be passed to NextAuth.js | ||
*/ | ||
const authProviders = [] | ||
|
||
/** | ||
* Add KeyCloak if parameters are defined. | ||
*/ | ||
if(varNotEmpty(process.env.KEYCLOAK_CLIENT_ID) && varNotEmpty(process.env.KEYCLOAK_ISSUER_URL) && varNotEmpty(process.env.KEYCLOAK_CLIENT_SECRET)){ | ||
authProviders.push( | ||
KeycloakProvider({ | ||
clientId: process.env.KEYCLOAK_CLIENT_ID, | ||
issuer: process.env.KEYCLOAK_ISSUER_URL, | ||
clientSecret: process.env.KEYCLOAK_CLIENT_SECRET | ||
}), | ||
) | ||
} | ||
|
||
/** | ||
* Add Google Provider if parameters are defined. | ||
*/ | ||
if(varNotEmpty(process.env.GOOGLE_CLIENT_ID) && varNotEmpty(process.env.GOOGLE_CLIENT_SECRET) ){ | ||
authProviders.push( | ||
GoogleProvider({ | ||
clientId: process.env.GOOGLE_CLIENT_ID, | ||
clientSecret: process.env.GOOGLE_CLIENT_SECRET | ||
}) | ||
) | ||
} | ||
/** | ||
* Add Authentik Provider if parameters are defined. | ||
*/ | ||
if(varNotEmpty(process.env.AUTHENTIK_CLIENT_ID) && varNotEmpty(process.env.AUTHENTIK_CLIENT_SECRET) && varNotEmpty(process.env.AUTHENTIK_ISSUER)){ | ||
|
||
authProviders.push( | ||
AuthentikProvider({ | ||
clientId: process.env.AUTHENTIK_CLIENT_ID, | ||
clientSecret: process.env.AUTHENTIK_CLIENT_SECRET, | ||
issuer: process.env.AUTHENTIK_ISSUER, | ||
}) | ||
) | ||
} | ||
export default authProviders |
Binary file added
BIN
+37.7 KB
cypress/screenshots/install.cy.ts/template spec -- passes (failed).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.