-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feature) start blockstack integration: Hello World
- Loading branch information
Zach Lysobey
committed
Jun 21, 2019
1 parent
3d36b39
commit bc053bf
Showing
9 changed files
with
120 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/index.html | ||
Access-Control-Allow-Origin: * | ||
Access-Control-Allow-Headers: "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding" | ||
Access-Control-Allow-Methods: "POST, GET, OPTIONS, DELETE, PUT" | ||
/manifest.json | ||
Access-Control-Allow-Origin: * | ||
Access-Control-Allow-Headers: "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding" | ||
Access-Control-Allow-Methods: "POST, GET, OPTIONS, DELETE, PUT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"hosting": { | ||
"public": "build", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
], | ||
"headers": [ { | ||
"source" : "manifest.json", | ||
"headers" : [ { | ||
"key" : "Access-Control-Allow-Origin", | ||
"value" : "*" | ||
} ] | ||
} ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
|
||
import { UserSession } from 'blockstack' | ||
|
||
interface Props { | ||
userSession: UserSession | ||
} | ||
export const Landing: React.FC<Props> = ({ userSession }) => { | ||
const signIn = () => userSession.redirectToSignIn() | ||
return <> | ||
<p>Landing...</p> | ||
|
||
<button | ||
onClick={signIn} | ||
> | ||
Sign in | ||
</button> | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
|
||
interface AppProps { | ||
name: string | ||
} | ||
export const SignedIn: React.FC<AppProps> = ({ | ||
name | ||
}) => { | ||
console.log({ name }) | ||
return <p>Signed In. Hello {name}!</p> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 'React-scripts start' sets up a development server that automatically | ||
// registers files with this name. This proxy file sets up a CORS header | ||
// for manifest.json, allowing sign in via Blockstack without using | ||
// the webpack configuration file that create-react-app has configured | ||
// and hidden. | ||
|
||
module.exports = function(app) { | ||
app.get('/manifest.json', (req, res, next) => { | ||
res.set({ | ||
'Access-Control-Allow-Origin': '*', | ||
'Access-Control-Allow-Headers': '*', | ||
'Access-Control-Allow-Methods': 'GET', | ||
'X-random': 'random' | ||
}); | ||
next(); | ||
}) | ||
}; |