svelte-social-auth
svelte-social-auth copied to clipboard
Upgrade Google Auth
Resolves #25
Upgrades from using gapi.auth2 to google.accounts.id (https://developers.google.com/identity/gsi/web).
This change, however, is breaking as the outputs from the events are different.
auth-successnow returns an object with user properties:nameemailpicture
auth-failurenow returns a basic stringinit-erroris no longer used
Once people are happy with the implementation then I will look at updating the documentation
Note that we don't validate the jwt signature, so it might be better to get rid of the new dependency and just bade64 decode the unencrypted part of the jwt
https://stackoverflow.com/questions/38552003/how-to-decode-jwt-token-in-javascript-without-using-a-library
Note that we don't validate the jwt signature, so it might be better to get rid of the new dependency and just bade64 decode the unencrypted part of the jwt
https://stackoverflow.com/questions/38552003/how-to-decode-jwt-token-in-javascript-without-using-a-library
Certainly if you're happy with having the suggested browser function in the codebase. I'll update this
Certainly if you're happy with having the suggested browser function in the codebase. I'll update this
Removed jwt-decode dependency and added the answer-marked implementation from stackoverflow ✅
lets pnpm link this to the app to try it first before we merge and release.
lets pnpm link this to the app to try it first before we merge and release.
👋🏻 Hey, just getting back to this today. I've done a decent amount of testing and reading through our internal use-cases.
@antony with minor changes to our login screen I've got this working as we would expect. I've exposed the whole token through the auth-success callback.
It's worth noting the GSI does not like running on non-https domains, other than localhost, so this will throw some complications for us and potentially other development workflows.
I've also noticed that button is now being respected on our login/sign up screens- e.g. not width: 100% by default which is correct. Potentially something else has changed in our platform but to match the same styles as previously seen I updated the styles:
:global(.social-auth-button button) {
width: 100%;
font-family: 'Cabin', sans-serif;
border-radius: 5px;
}
But I don't think this is anything to do with this pull request as looking at the code I have not changed anything relating to styles.
Thanks for the PR! I installed from this commit and importing failed, but copying over the GoogleAuth.svelte file and using it like any other component seems to work
:)
lets also consider this https://github.com/beyonk-adventures/svelte-social-auth/pull/14 when we merge