no implicit any - force return

add some comments
This commit is contained in:
lukas 2021-03-19 19:10:13 +01:00
parent 5dbbd34d3a
commit f2ec5b644d
5 changed files with 7 additions and 32 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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%",

View File

@ -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 !== '') {