Download wp-calypso/client/auth/controller.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/wp-calypso/client/auth/controller.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/wp-calypso/client/auth/controller.js
-
curl -L -o controller.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/wp-calypso/client/auth/controller.js
382 Bytes
| import store from 'store'; | |
| // Store token into local storage | |
| export function storeToken( context ) { | |
| if ( context.hash?.access_token ) { | |
| store.set( 'wpcom_token', context.hash.access_token ); | |
| } | |
| if ( context.hash?.expires_in ) { | |
| store.set( 'wpcom_token_expires_in', context.hash.expires_in ); | |
| } | |
| const { next = '/' } = context.query; | |
| document.location.replace( next ); | |
| } | |