Skip to content

Session token missing while creating new user. #8477

@yog27ray

Description

@yog27ray

Issue Description

On creating a new user session token is missing. Below are the steps to reproduce.

package.json

{
  "name": "parse-server-error",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.18.2",
    "http": "^0.0.1-security",
    "parse-server": "6.1.0-alpha.7"
  }
}

app.js

const express = require('express');
const http = require('http');
const { ParseServer } = require('parse-server');

const app = express();
const server = http.createServer(app);

const parseServerOption = {
  databaseURI: 'mongodb://mongo:27017/test',
  appId: 'myAppId',
  masterKey: 'myMasterKey',
  serverURL: 'http://localhost:9000/api/parse',
}


async function start() {
  const parseServer = new ParseServer(parseServerOption);
  await parseServer.start();
  app.use('/api/parse', parseServer.app);
  server.listen(9000, '0.0.0.0', async () => {
    console.log('>>>>server running');
    const user = new Parse.User();
    await user.save({ username: 'test', password: 'test' }, { useMasterKey: true });
    console.log('>>>>userId:', user.id, '\tsessionToken:', user.getSessionToken());
  });
}

start();

Start Server

node -v
v16.16.0
npm -v
8.11.0
node app.js

Output

warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowExpiredAuthDataToken' default will change to 'false' in a future version.
>>>>server running
>>>>userId: yzNE1MbWh6  sessionToken: undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions