Skip to content

Commit

Permalink
Merge pull request #73 from intri-in/nextAuth
Browse files Browse the repository at this point in the history
v0.3.0-dev
  • Loading branch information
intri-in authored Jul 30, 2023
2 parents 1221aae + 7a7d3bb commit 9f9e411
Show file tree
Hide file tree
Showing 106 changed files with 2,773 additions and 442 deletions.
15 changes: 8 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ docs
config/config.json
package-withSequelize.json

temp/

#Sequelise Temporary Ignore list
models/
config/
migrations/
src/helpers/api/installSequelize.ts
src/helpers/installation.ts
src/helpers/models.ts
.sequelizerc
# models/
# config/
# migrations/
# src/helpers/api/installSequelize.ts
# src/helpers/installation.ts
# src/helpers/models.ts
# .sequelizerc
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ COMBINEDCOMMITMESSAGE
config/config.json
package-withSequelize.json


temp/
#Sequelise Temporary Ignore list
models/
config/
migrations/
src/helpers/api/installSequelize.ts
src/helpers/installation.ts
src/helpers/models.ts
.sequelizerc
# models/
# config/
# migrations/
# src/helpers/api/installSequelize.ts
# src/helpers/installation.ts
# src/helpers/models.ts
# .sequelizerc
7 changes: 7 additions & 0 deletions .sequelizerc
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'),

}
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
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

v0.1.9
- Removed Fullcalendar script import from _app.js
- Looks like calendar view works without it.
Expand Down
11 changes: 8 additions & 3 deletions COMMITMESSAGE.md
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
27 changes: 27 additions & 0 deletions config/config.js
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"
}
}

48 changes: 48 additions & 0 deletions config/nextAuthProviders.js
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cypress/videos/install.cy.ts.mp4
Binary file not shown.
Loading

0 comments on commit 9f9e411

Please sign in to comment.