Skip to content

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

Description

@H4ppyM4jor

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions