Error when deploying Svelte examples from DFINITY samples bank

I just lost more time to realize that what really solved the problem was this post :

After some new try, if I follow the readme and use this command in internet identity folder :

II_ENV=development dfx deploy --no-wallet --argument '(null)'
It’s impossible to create a new anchor or login in internet Identity.

The solution was to use :
II_FETCH_ROOT_KEY=1 dfx deploy --no-wallet --argument '(null)'

@Severin , maybe it should be updated, I don’t know.

1 Like

In the auth.svelte from svelte-motoko-starter, I see that I can call backend method with :
$auth.actor.myMethod()

However, it seems to work if the person is logged or not logged. Is there a way to allow call only if the person is logged, and what is the good implementation ? Sure, I can hide button and all interface that should not be available for a logged out user… But I want to understand.

Sure you can save the users in the canister and then compare the principal that call the function

public shared query ({caller}) func get(key : Text) : async (?Data) {
   if caller == myUser ....

Worth starting a new thread if you’ve got more particular question about it for more visibility.

e.g. in the doc

Thanks for the ping, fixing it in this PR

1 Like