hi, Is it possible to use a userPool already creat...
# sst
j
hi, Is it possible to use a userPool already created in cognito for the auth? without having to create a new one?
t
Yeah if you have the user pool id you can do UserPool.fromUserPoolId
j
take a look
t
Ah you can't change the details of the userpool like that
You can only pass it through
j
uhhm, well how can I reuse a poolId?
I am somewhat confused with the auth process of sst and cognito.
I suppose that with UserPool.fromUserPoolId I already have the userPool but how can I pass it to sst.auth?
t
You can pass it exactly as is
Without modifying it like in your example
I'll send an example in a few
Copy code
const auth = new sst.Auth(this, "Auth", { cognito: { userPool: cognito.UserPool.fromuserPoolId(...) } } )
j
Type 'IUserPool' is not assignable to type 'UserPool | UserPoolProps | undefined'. Type 'IUserPool' is missing the following properties from type 'UserPool': userPoolProviderName, userPoolProviderUrl, triggers, addTrigger, and 23 more.ts(2322)
does not work