Commit graph

62 commits

Author SHA1 Message Date
Kevin Jennison
450e7130b0
Add example: Firebase authentication + SSR (#15202)
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2021-01-23 15:49:14 +01:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
mongolyy
7f23954f7e
Update database config explanation in with-firebase-app example (#20709)
I made the following changes.

- Addition of procedure for setting private_key
- Addition of procedure for creating a database and setting database_url
2021-01-04 20:25:57 +00:00
Matsumoto Toshi
5ecdcab648
fix: Using getIdToken to get a token (#18599)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-03 20:40:42 -05:00
Tuan Nguyen
c28d39e47d
Use ya in case xa is false (#18074)
This closes [#18023](https://github.com/vercel/next.js/issues/18023). 

I was following the example mentioned in the issue (https://github.com/vercel/next.js/tree/canary/examples/with-firebase-authentication) and for some reason `xa` was always false, failing fetching food. Through `console.log` I saw that `ya` contained a token value and using `ya` worked.
2020-10-21 01:17:39 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
NorbertLuszkiewicz
c03d4931de
Simplify example usage instructions (#16678)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:22:02 -04:00
Francis Rodrigues
4c3d3b7122
Fix: with-firebase-authentication event listener (#16057)
Reference to discussion https://github.com/vercel/next.js/discussions/16010
Bug fixes to `with-firebase-authentication` example that enter in a loop `maximum update depth exceeded errors` becase of the `onIdTokenChanged` Firebase auth method.
I added a clean up event listener.
2020-08-11 01:05:42 +00:00
Joseph Knowles
432a1dec6a
Fix with-firebase-authentication example: Update the cookie when ID token refreshes on client (#15628)
I noticed a problem with the example - when you leave it logged in for more than an hour it breaks. The example API call starts to fail with `auth/id-token-expired`.

Looking at the code I saw that we never update the id token after signing in, but firebase automatically updates it every hour, meaning our `verifyIdToken` fails after an hour. 

So I used the `onIdTokenChanged` function from firebase to update the cookie every time the id token changes.

I'm open to suggestions on refactoring the code I've added.
2020-08-05 08:38:26 +00:00
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
abhik-b
583d1a0a02
Updated useUser.js (#14974)
UPDATE I ADDED:
setUser() 
AFTER REMOVING cookie IN return STATEMENT OF logout ARROW FUNCTION

There might be some cases where you do not want to redirect users after logout rather let them remain in that same page BUT let them know they have logged out by some UI changes .

For that cases you might need the 'user' hook to update when users logs out .

CURRENTLY the 'user' hook DOES NOT UPDATE AUTOMATICALLY when the user logs out . 
PAGE REFRESH NEEDED to update that.

So i propose that we might add setUser() to update user so that  user never returns true until user is set some value again
2020-07-13 23:43:21 +00:00
Lindsey Simon
68f4680549
Update index.js (#14771)
Fix CSS `display` on login link.
2020-07-01 14:40:22 +00:00
matamatanot
87bb11c98c
Remove next-cookies and prop-types (#14579) 2020-06-26 14:55:32 +02:00
Oğuzcan Köse
c690a68b3c
Update index.js (#14528)
* Update index.js

* Update index.js

* Update examples/with-firebase-authentication/pages/index.js

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-06-24 16:53:04 -05:00
Gourav Goyal
335e9d4e8d
Added missing .env.local.example file for with example firebase-authentication-app (#14235)
Added missing .env.local.example file for with example firebase-authentication-app.
I've tested it personally and it is working fine.
2020-06-16 17:30:10 +00:00
Todor Totev
6c8b7cde7d
[Examples] remove getInitialProps from with-firebase-authentication (#13895)
Related to [11014](https://github.com/vercel/next.js/issues/11014)
2020-06-11 17:38:29 +00:00
Joe Haddad
4a12fb0a5f
Normalize example gitignores (#13768)
This removes a bunch of unnecessary `.gitignore`s and fixes some CMS examples that don't ignore `node_modules` etc.
2020-06-04 20:39:52 +00:00
Giulio Fagioli
00eef1720c
Update Firebase Auth Example for New Env Support (#13587)
Prefixed variables name with NEXT_PUBLIC_.

Solving #13585 issue related to get undefined from process.env.VARNAME inside .env* files.

I'm not secure if SESSION_SECRET_* need the prefix.
2020-06-04 07:01:22 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
Joseph Knowles
83827f76d3
Uncomment private key (#13277) 2020-05-23 11:19:28 -05:00
TodorTotev
8618ab85ad
More redundant imports @ examples (#13190)
Again, related to [12964](https://github.com/zeit/next.js/issues/12964)

After checking all the other examples and the ongoing pull requests, I believe that with this PR being merged, all the examples should be free of redundant react imports.
Let me know if you want me to edit anything that you don't like.

Regards

with-typescript
with-atstroturf
with-atlaskit
with-styletron
with-styled-components-rtl
with-stylesheet
with-stomp
with-stitches-styled
with-stitches
with-slate
with-sentry-simple
with-sentry
with-segment-analytics
with-rematch
with-relay-modern
with-reflux
with-redux-wrapper
with-react-relay-network
with-react-native
with-react-multi-carousel
with-react-jss
with-react-helmet
with-react-ga
with-quill-js
with-prefetching
with-google-analytics-amp
with-google-analytics
with-framer-motion
with-flow
with-firebase-hosting
with-firebase-cloud-messaging
with-firebase-authentication
with-expo
with-dynamic-app-layout
with-draft-js
with-cxs
with-cerebral
with-ant-design-mobile
with-algolia-react-instantsearch
using-preact
progressive-render
2020-05-22 15:33:04 +00:00
Joe Haddad
dbad9db68c
Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Willian Justen
18dc1f66c6 Remove isomorphic-unfetch from examples (#12948)
Since 9.4 release, fetch is pollyfilled by default from #12353,
so the import is not needed anymore.
2020-05-15 22:23:55 +02:00
Luis Alvarez D
f0220e6a9d
[Examples] Update firebase authentication (#12687) 2020-05-10 21:32:20 -04:00
Marcus Koh
6a8aef71fe
Updated with-firebase-authentication to fix errors (#12204) 2020-05-02 01:13:08 -04:00
Tim Neutkens
483bd3ddda
Rename ZEIT to Vercel (#12075)
* Find/replace

* Update more URLs

* More rename

* Fix remaining examples

* More updates

* Update create-next-app

* Update remaining text

* Update

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-21 11:47:12 +02:00
David Janda
641976a471
Replace getInitialProps with getServerSideProps (#11586) 2020-04-02 16:36:18 -05:00
Shu Uesugi
c57cdbb31d
Rename zeit.co/new → zeit.co/import (#10674)
* Replace zeit.co/new → zeit.co/import

* Update deployment.md
2020-02-24 19:08:34 -05:00
Shu Uesugi
5f041447bc
Remove Now CLI reference from examples (#10501)
* Find/Replace "Deploy it to the cloud..."

* Find/Replace "Deploy it to the cloud..." (no colon)

* Find/Replace "Deploy it to the cloud..." for firebase

* Convert remaining ones

* Storybook deployment

* Update with-stripe-typescript

* Update contributing.md

* Remove `now`

* Update examples/with-stripe-typescript/README.md

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
2020-02-12 17:14:57 -05:00
Sang Song
9352392f4f chore(examples): Update firebase version (#10145) 2020-01-17 23:06:58 +01:00
Shu Uesugi
6804039e94 Make example READMEs more consistent (#10124)
* npx create → npm init

* Fix inconsistent instructions

* Update amp-first

* Update with-graphql-react

* with-firebase-cloud-messaging

* Update with-higher-order-component

* change create-next-app url

* Update create-next-app instruction

* Update instructions to use npm instead of npx

* Move "the idea behind the example" to top

* Rename

* Rename

* Update contributing.md with a README template
2020-01-16 23:23:56 +01:00
bokuweb
2cd8f1c920 Update server.js (#10056)
I think `httpOnly` property should set as `cookie`'s property.
This is because `SessionOptions` is following.

```
  interface SessionOptions {
    secret: string | string[];
    name?: string;
    store?: Store | MemoryStore;
    cookie?: {
      maxAge?: number;
      signed?: boolean;
      expires?: Date;
      httpOnly?: boolean;
      path?: string;
      domain?: string;
      secure?: boolean | 'auto';
      encode?: (val: string) => string;
      sameSite?: boolean | 'lax' | 'strict' | 'none';
    };
    genid?(req: express.Request): string;
    rolling?: boolean;
    resave?: boolean;
    proxy?: boolean;
    saveUninitialized?: boolean;
    unset?: string;
  }
```
2020-01-13 12:17:06 +01:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
Michael Lustig
a809368e59 Fix login popup not working (#8700) 2019-09-10 22:16:20 -04:00
Jean
08dcbdca9c Improve With Firebase Authentication example (#8533)
* [with-firebase-authentication] remove deprecated warning

* [with-firebase-authentication] improve client and server credentials example

* [with-firebase-authentication] fix typo in the docs
2019-08-27 15:39:13 -04:00
Thijs Koerselman
8243af2519 Update example with firebase auth (#8127)
* Add sessions folder to prevent errors on first run

* Update readme steps to reflect current firebase ui

* Use default directory for sessions-file-store

* Remove obsolete databaseURL from config
2019-07-26 12:14:14 -05:00
Matthew Sweeney
0cd2732c7f
Remove deploy to now button from all examples (#7101) 2019-05-27 12:22:05 -07:00
Connor Davis
3fa04620e7 Remove Deploy To Now buttons (#7126)
* Remove Deploy To Now buttons

* Remove remaining buttons
2019-04-24 10:53:58 +02:00
k-kawakami
d9060f5abd Remove trailing spaces (#6547)
### changes
#### remove trailing spaces

When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.

`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tslint error occurs at commit.
2019-03-07 17:40:08 +01:00
Juan Olvera
7e12997af6 Test updater script on examples folder (#5993)
I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:

```
$ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
```

This PR contains the result against the examples folder.
2019-01-05 12:19:27 +01:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
moflo
b0148cf453 Update for use with Firestore (#5793)
Google seems to be deprecated the legacy realtime database and moving towards default use of Firestore, although it's still officially in beta. This PR migrates towards Firestore and the recommended loading methods for the Firebase 5.6.0 libraries. Note: the Firebase and Firebase-Admin dependencies should be updated to 5.6.0 and 6.3.0 respectively.
2018-12-10 14:25:40 +01:00
Jeroen Knoops
510eb5771c Updates version of firebase (#5829)
Firebase has some issues with grpc. ( Firebase has some issues with grpc ) This is resolved in a newer version of firebase. Especially with npm 6.4.1. https://github.com/firebase/firebase-js-sdk/issues/1341

Issue #5688
2018-12-06 11:17:18 +01:00
Obed Marquez Parlapiano
b63487c331 Update with-firebase-auth example (#5742)
- The with-firebase-auth example won't run unless a database with proper rules is created first. 
- Add a small error callback to addDbListener to help with debugging if someone's database connection doesn't work.
2018-11-25 14:57:15 +01:00
Michael Herold
5b3578e58f #4751 - Explicitly mention install when cloning examples (#4758)
Preferably this installation wouldn't be necessary, but in lieu of a fix...

#4751
2018-07-11 23:56:15 +02:00
James Hegedus
f2e56609cd Examples: stabalise README format and create-next-app usage (#4009)
* Examples: clarify language around Yarn create & npx

* add missing READMEs and create-next-app usage

* suggest people tag jthegedus in firebase related issues

* add yarn alt instructions

* cerebraljs example readme & fixes
2018-04-03 14:19:05 +02:00
Tim Neutkens
ebf0c47c25
Upgrade standard.js (#4064)
* Upgrade standard.js

# Conflicts:
#	yarn.lock

* Upgrade babel-eslint
2018-03-27 20:11:03 +02:00