Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property '0' of null #82

Open
H4ppyM4jor opened this issue Apr 10, 2020 · 0 comments
Open

TypeError: Cannot read property '0' of null #82

H4ppyM4jor opened this issue Apr 10, 2020 · 0 comments

Comments

@H4ppyM4jor
Copy link

H4ppyM4jor commented Apr 10, 2020

Hi!
I am trying to implement node-sspi in my reactjs project using react-admin framework.
I tested node-sspi in a test express app and it worked just right.

I dont really know how to implement this outside of the express context, but I can not really try either because I get the error "TypeError: Cannot read property '0' of null" by just requiring it.

import nodeSSPI from 'node-sspi'; var util = require('util');

export default {

// called when the user attempts to log in
login: ({ username }) => {
    localStorage.setItem('username', username);
    // accept all username/password combinations
    return Promise.resolve();
},
// called when the user clicks on the logout button
logout: () => {
    localStorage.removeItem('username');
    return Promise.resolve();
},
// called when the API returns an error
checkError: ({ status }) => {
    if (status === 401 || status === 403) {
        localStorage.removeItem('username');
        return Promise.reject();
    }
    return Promise.resolve();
},
// called when the user navigates to a new location, to check for authentication
checkAuth: () => {
    return localStorage.getItem('username')
        ? Promise.resolve()
        : Promise.reject();
},
// called when the user navigates to a new location, to check for permissions / roles
getPermissions: () => Promise.resolve(),

};`
nodesspi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant