#1 2013-01-17 13:53:46

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Change password

Hello,

In the sample 14 theres a code to set user and password:

 Client.SetUser('User','synopse'); 

How can we change the name of the user and the password of the server?

Offline

#2 2013-01-17 15:02:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Change password

Update the corresponding table, as stated by the doc.
That is, TSQLAuthUser table.

Offline

#3 2013-01-17 17:33:36

arquivo59
Member
Registered: 2013-01-14
Posts: 24

Re: Change password

I'm sorry if I have been annoying, is that I'm accustomed to the Datasnap, and all this is different to me.


I'm suppose to create a model off an TSQLAuthUser and TSQLAuthGroup?

Offline

#4 2013-06-16 11:20:21

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

Re: Change password

So this snippet of code should change the password of the default user?

  fServer := TSQLRestServerFullMemory.Create(fModel,'.\test.json',false,true);
  fServer.CreateMissingTables(0);
  aMormotUser := TSQLAuthUser.Create(fServer, 'Name=?', ['User']);
  aMormotUser.PasswordPlain := 'NewPasswd';
  assert( fServer.Update(aMormotUser), 'Default User password not changed!');

Unfortunately, the assert fails. What else needs to be done, so the password is changed? Or is this not the way to go?


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

Board footer

Powered by FluxBB