Skip to content

Commit

Permalink
fix: login should store user in preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed Apr 8, 2024
1 parent 39b89b2 commit a9669c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { goto, m, r } from '$lib/i18n';
import { regenerateKeypair } from '$lib/keypairoom';
import { setKeypairPreference } from '$lib/preferences/keypair.js';
// import { unlockApp } from '$lib/preferences/locked.js';
import { z } from 'zod';
import { generateDid } from '../../_lib/index.js';
import { unlockApp } from '$lib/preferences/locked.js';
//
Expand Down Expand Up @@ -66,7 +66,7 @@
</FormError>
</div>
<div class="flex flex-col gap-6">
<d-button role="button" expand type="submit" tabindex={0}>{m.Login()}</d-button>
<d-button role="button" expand type="submit" tabindex={0}>Login</d-button>

<d-button color="outline" href={r('/login/questions')} role="button" expand>
{m.KEYPAIR_RECOVERY()}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[[lang]]/(auth)/login/_lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const generateSignroomUser = async (email: string) => {
data
});

await setUser(res.result.login_output?.record.id, email);

return res.result.output;
};
Expand Down Expand Up @@ -93,6 +92,7 @@ export const generateDid = async (email: string) => {
data
})) as unknown as DIDResponse;

await setUser(res.result.login_output?.record.id, email);
await setDIDPreference(res.result.output.did);

return res.result.output;
Expand Down
3 changes: 2 additions & 1 deletion src/routes/[[lang]]/(auth)/login/_lib/scriptGenerateDid.zen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Rule unknown ignore
Rule unknown ignore
Given I send pb_address 'pb_address' and create pb_client
Given I send my_credentials 'my_credentials' and login and output into 'login_output'
Given I have a 'string dictionary' named 'login_output'
Expand All @@ -14,4 +14,5 @@ and I move 'headers' in 'send_parameters'

Then I print 'url'
and I print 'send_parameters'
Then I print 'login_output'
Then I send url 'url' and send send_parameters 'send_parameters' and send request and output into 'output'

0 comments on commit a9669c7

Please sign in to comment.