|
|
@ -149,13 +149,18 @@ To replace the default login, do the following: |
|
|
|
2. Locate the `redirectToSignIn()` method at line 4. |
|
|
|
3. Replace `redirectToSignIn()` method with the `blockstack.UserSession.redirectToSignInWithAuthRequest(authRequest)` method. |
|
|
|
|
|
|
|
```javascript |
|
|
|
var userSession = new UserSession() |
|
|
|
userSession.redirectToSignInWithAuthRequest(authRequest) |
|
|
|
``` |
|
|
|
|
|
|
|
The `authRequest` is the authentication request generated by `makeAuthRequest()` method. |
|
|
|
|
|
|
|
4. Immediately above the method you just added and below the `event.preventDefault()` method, construct a String `const` for the `authRequest`: |
|
|
|
|
|
|
|
``` |
|
|
|
const authRequest = blockstack.makeAuthRequest( |
|
|
|
blockstack.generateAndStoreTransitKey(), |
|
|
|
const authRequest = userSession.makeAuthRequest( |
|
|
|
userSession.generateAndStoreTransitKey(), |
|
|
|
'http://localhost:8080/', |
|
|
|
'http://localhost:8080/manifest.json', |
|
|
|
['store_write', 'publish_data'], |
|
|
@ -245,12 +250,13 @@ import { |
|
|
|
redirectToSignInWithAuthRequest |
|
|
|
} from 'blockstack'; |
|
|
|
|
|
|
|
const authRequest = makeAuthRequest(undefined, undefined, undefined, undefined, undefined, undefined, { |
|
|
|
var userSession = new UserSession() |
|
|
|
const authRequest = userSession.makeAuthRequest(undefined, undefined, undefined, undefined, undefined, undefined, { |
|
|
|
solicitGaiaHubUrl: true, |
|
|
|
recommendedGaiaHubUrl: 'https://mygaiahub.com' |
|
|
|
}); |
|
|
|
|
|
|
|
const authRequest = makeAuthRequest( |
|
|
|
const authRequest = userSession.makeAuthRequest( |
|
|
|
generateAndStoreTransitKey(), |
|
|
|
'http://localhost:8080/', |
|
|
|
'http://localhost:8080/manifest.json', |
|
|
@ -262,7 +268,7 @@ const authRequest = makeAuthRequest( |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
redirectToSignInWithAuthRequest(authRequest); |
|
|
|
userSession.redirectToSignInWithAuthRequest(authRequest); |
|
|
|
``` |
|
|
|
|
|
|
|
Passing these parameters changes the storage hub URL prompt to the following: |
|
|
|