-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(client): add auth logout method #74
Conversation
Add kwil.auth.logout() method to remove cookie when using KGW.
src/auth/auth.ts
Outdated
} | ||
|
||
/** | ||
* Authenticates a user with the Kwil Gateway (KGW). This is required to execute mustsign view actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is outdated, 'mustsign' action is no longer supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
src/core/auth.ts
Outdated
version: string, | ||
chainId: string, | ||
): void { | ||
if (authParm.domain !== domain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is problematic if run against older kgw version? Since old kgw version won't return those fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good point - how are you handling this with Kwil-cli? Maybe we update the version number? So if > version 1, then run the verifyAuthProperties
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't change 'version', since 'version' is for something like template.
https://github.com/kwilteam/kwil-db/pull/657/files#diff-2a7eaeea47cbb7c8cd1df3a3972976df3131d7634f9d6a1d26d2409ee064718cR165 I only compare if the field is returned from KGW
add checks for auth properties from server before signing auth msg Update kwil.test.ts update auth msg
67da0b1
to
d285a79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add kwil.auth.logout() method to remove cookie when using KGW.