Skip to content

Commit

Permalink
fix: randomString btoa fallback for SSR (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugome authored and pi0 committed Aug 22, 2018
1 parent a8fbda8 commit 604cc5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const encodeQuery = queryObject => {
.join('&')
}

export const randomString = () => btoa(Math.random() + '').replace('==', '')
export const randomString = () => (process.browser ? btoa(Math.random() + '') : Buffer.from(Math.random() + '').toString('base64')).replace('==', '')

export const routeOption = (route, key, value) => {
return route.matched.some(m => {
Expand Down

0 comments on commit 604cc5d

Please sign in to comment.