safe-global / safe-wallet-web

Safe{Wallet} – smart contract wallet for Ethereum (ex-Gnosis Safe multisig)
https://app.safe.global
GNU General Public License v3.0
311 stars 360 forks source link

feat: Add method to Sign in with Ethereum [SW-28] #3853

Closed usame-algan closed 6 days ago

usame-algan commented 2 weeks ago

What it solves

Adds a new function signInWithEthereum that can be used to prompt the user to sign an EIP-4361 message and request an access_token from the CGW that is stored as a cookie and can be used in subsequent requests via the credentials: include header.

How to test

You can add a new button and trigger it manually e.g.

const SignInButton = () => {
    const provider = useWeb3()

    if (!provider) return null

    return <button onClick={() => signInWithEthereum(provider)}>Sign in</button>
}

Checklist

github-actions[bot] commented 2 weeks ago

Branch preview

βœ… Deploy successful!

Website: https://siwe--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6

Storybook: https://siwe--walletweb.review.5afe.dev/storybook/

github-actions[bot] commented 2 weeks ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action

github-actions[bot] commented 2 weeks ago

πŸ“¦ Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. πŸ€–

This PR introduced no changes to the JavaScript bundle! πŸ™Œ

github-actions[bot] commented 2 weeks ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements 78.78% 11385/14452
πŸ”΄ Branches 58.09% 2753/4739
🟑 Functions 65.74% 1827/2779
🟒 Lines 80.16% 10260/12800

Test suite run success

1413 tests passing in 195 suites.

Report generated by πŸ§ͺjest coverage report action from 064fda40df750b3c6473076e6f44e7e4ff006667

notion-workspace[bot] commented 2 weeks ago

Add SiWE call in Frontend

github-actions[bot] commented 1 week ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action

usame-algan commented 1 week ago

The lint issues will be fixed after https://github.com/safe-global/safe-wallet-web/pull/3865 is merged

github-actions[bot] commented 6 days ago

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A

Report generated by eslint-plus-action