diff --git a/.eslintrc.js b/.eslintrc.js index 0a3364a..a6e3655 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -95,7 +95,8 @@ module.exports = { }, rules: { - // 'multiline-ternary': [1, 'always-multiline'], + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/explicit-function-return-type": "error", // General 'comma-dangle': [1, 'never'], // allow or disallow trailing commas diff --git a/apiGo/api/oauth/CustomClientStore.go b/apiGo/api/oauth/CustomClientStore.go index 56857b1..414dfb6 100644 --- a/apiGo/api/oauth/CustomClientStore.go +++ b/apiGo/api/oauth/CustomClientStore.go @@ -24,6 +24,7 @@ func NewCustomStore() oauth2.ClientStore { func (a *CustomClientStore) GetByID(id string) (oauth2.ClientInfo, error) { password := settings.GetPassword() + // if password not set assign default password if password == nil { defaultpassword := "openmediacenter" password = &defaultpassword diff --git a/apiGo/api/oauth/Oauth.go b/apiGo/api/oauth/Oauth.go index 5d25d69..ef5ec93 100644 --- a/apiGo/api/oauth/Oauth.go +++ b/apiGo/api/oauth/Oauth.go @@ -3,7 +3,6 @@ package oauth import ( "gopkg.in/oauth2.v3/errors" "gopkg.in/oauth2.v3/manage" - //"gopkg.in/oauth2.v3/models" "gopkg.in/oauth2.v3/server" "gopkg.in/oauth2.v3/store" "log" @@ -17,18 +16,9 @@ func InitOAuth() { // token store manager.MustTokenStorage(store.NewMemoryTokenStore()) - //clientStore := store.NewClientStore() - //// todo we need to check here if a password is enabled in db -- when yes set it here! - //clientStore.Set("openmediacenter", &models.Client{ - // ID: "openmediacenter", - // Secret: "openmediacenter", - // Domain: "http://localhost:8081", - //}) - // - //manager.MapClientStorage(clientStore) - - strtest := NewCustomStore() - manager.MapClientStorage(strtest) + // create new secretstore + clientStore := NewCustomStore() + manager.MapClientStorage(clientStore) srv = server.NewServer(server.NewConfig(), manager) srv.SetClientInfoHandler(server.ClientFormHandler) diff --git a/package.json b/package.json index e15b6e5..7099d91 100644 --- a/package.json +++ b/package.json @@ -39,23 +39,6 @@ }, "proxy": "http://127.0.0.1:8081", "homepage": "/", - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ], - "overrides": [ - { - "files": [ - "**/*.ts?(x)" - ], - "rules": { - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/explicit-function-return-type": "error" - } - } - ] - }, "browserslist": { "production": [ ">0.2%", diff --git a/src/App.tsx b/src/App.tsx index 816628d..17bda85 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -60,7 +60,7 @@ class App extends React.Component<{}, state> { }); // set the hook to load passwordfield on global func call - GlobalInfos.loadPasswordPage = (callback?: () => void) => { + GlobalInfos.loadPasswordPage = (callback?: () => void): void => { // try refreshing the token refreshAPIToken((err) => { if (err !== '') {