Skip to content

Commit 0abdd67

Browse files
committed
Fixed Oauth Bug
1 parent 1fa714f commit 0abdd67

File tree

3 files changed

+385
-3
lines changed

3 files changed

+385
-3
lines changed

docs/javascript-snippets.md

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
2+
# Javascript snippets
3+
4+
- `np` - nextPage
5+
- `npssp` - nextPageServerSideProps
6+
- `npsp` - nextPageStaticProps
7+
- `npspth` - nextPageStaticPaths
8+
- `nssp` - nextServerSideProps
9+
- `nsp` - nextStaticProps
10+
- `nspth` - nextStaticPaths
11+
- `nip` - nextInitialProps
12+
- `nimg` - nextImage
13+
- `napp` - nextApp
14+
- `ndoc` - nextDocument
15+
- `napi` - nextApi
16+
- `nmid` - nextMiddleware
17+
18+
## `np` - nextPage
19+
20+
```javascript
21+
const FileName = ({}) => {
22+
return <div></div>
23+
}
24+
25+
export default FileName
26+
```
27+
28+
## `npssp` - nextPageServerSideProps
29+
30+
```javascript
31+
const FileName = ({}) => {
32+
return <div></div>
33+
}
34+
35+
export const getServerSideProps = async (ctx) => {
36+
return {
37+
props: {}
38+
}
39+
}
40+
41+
export default FileName
42+
```
43+
44+
## `npsp` - nextPageStaticProps
45+
46+
```javascript
47+
const FileName = ({}) => {
48+
return <div></div>
49+
}
50+
51+
export const getStaticProps = async (ctx) => {
52+
return {
53+
props: {},
54+
}
55+
}
56+
57+
export default FileName
58+
```
59+
60+
## `npspth` - nextPageStaticPaths
61+
62+
```javascript
63+
const FileName = ({}) => {
64+
return <div></div>
65+
}
66+
67+
export const getStaticPaths = async () => {
68+
return {
69+
paths: [],
70+
fallback: false,
71+
}
72+
}
73+
74+
export default FileName
75+
```
76+
77+
## `nssp` - nextServerSideProps
78+
79+
```javascript
80+
export const getServerSideProps = async (ctx) => {
81+
return {
82+
props: {}
83+
}
84+
}
85+
```
86+
87+
## `nsp` - nextStaticProps
88+
89+
```javascript
90+
export const getStaticProps = async (ctx) => {
91+
return {
92+
props: {},
93+
}
94+
}
95+
```
96+
97+
## `nspth` - nextStaticPaths
98+
99+
```javascript
100+
export const getStaticPaths = async () => {
101+
return {
102+
paths: [],
103+
fallback: false,
104+
}
105+
}
106+
```
107+
108+
## `nip` - nextInitialProps
109+
110+
```javascript
111+
FileName.getInitialProps = async (ctx) => {
112+
return {
113+
114+
}
115+
}
116+
```
117+
118+
## `nimg` - nextImage
119+
120+
```javascript
121+
<Image src="" alt="" />
122+
```
123+
124+
## `napp` - nextApp
125+
126+
```javascript
127+
export default function MyApp({ Component, pageProps }) {
128+
return <Component {...pageProps} />
129+
}
130+
```
131+
132+
## `ndoc` - nextDocument
133+
134+
```javascript
135+
import Document, { Html, Head, Main, NextScript } from 'next/document'
136+
137+
class MyDocument extends Document {
138+
static async getInitialProps(ctx) {
139+
const initialProps = await Document.getInitialProps(ctx)
140+
return { ...initialProps }
141+
}
142+
143+
render() {
144+
return (
145+
<Html>
146+
<Head />
147+
<body>
148+
<Main />
149+
<NextScript />
150+
</body>
151+
</Html>
152+
);
153+
}
154+
}
155+
156+
export default MyDocument
157+
```
158+
159+
## `napi` - nextApi
160+
161+
```javascript
162+
export default async function handler(req, res) {
163+
164+
}
165+
```
166+
167+
## `nmid` - nextMiddleware
168+
169+
```javascript
170+
import { NextResponse } from 'next/server'
171+
export async function middleware(request) {
172+
173+
}
174+
175+
export const config = {
176+
matcher: '/about/:path*',
177+
}
178+
```

docs/typescript-snippets.md

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
2+
# Typescript snippets
3+
4+
- `np` - nextPage
5+
- `npssp` - nextPageServerSideProps
6+
- `npsp` - nextPageStaticProps
7+
- `npspth` - nextPageStaticPaths
8+
- `nssp` - nextServerSideProps
9+
- `nsp` - nextStaticProps
10+
- `nspth` - nextStaticPaths
11+
- `nip` - nextInitialProps
12+
- `nimg` - nextImage
13+
- `napp` - nextApp
14+
- `ndoc` - nextDocument
15+
- `napi` - nextApi
16+
- `nmid` - nextMiddleware
17+
18+
## `np` - nextPage
19+
20+
```typescript
21+
import { NextPage } from 'next'
22+
23+
interface Props {}
24+
25+
const FileName: NextPage<Props> = ({}) => {
26+
return <div></div>
27+
}
28+
29+
export default FileName
30+
```
31+
32+
## `npssp` - nextPageServerSideProps
33+
34+
```typescript
35+
import { NextPage, GetServerSideProps } from 'next'
36+
37+
interface Props {}
38+
39+
const FileName: NextPage<Props> = ({}) => {
40+
return <div></div>
41+
}
42+
43+
export const getServerSideProps: GetServerSideProps = async (ctx) => {
44+
return {
45+
props: {}
46+
}
47+
}
48+
49+
export default FileName
50+
```
51+
52+
## `npsp` - nextPageStaticProps
53+
54+
```typescript
55+
import { NextPage, GetStaticProps } from 'next'
56+
57+
interface Props {}
58+
59+
const FileName: NextPage<Props> = ({}) => {
60+
return <div></div>
61+
}
62+
63+
export const getStaticProps: GetStaticProps = async (ctx) => {
64+
return {
65+
props: {},
66+
}
67+
}
68+
69+
export default FileName
70+
```
71+
72+
## `npspth` - nextPageStaticPaths
73+
74+
```typescript
75+
import { NextPage, GetStaticPaths } from 'next'
76+
77+
interface Props {}
78+
79+
const FileName: NextPage<Props> = ({}) => {
80+
return <div></div>
81+
}
82+
83+
export const getStaticPaths: GetStaticPaths = async () => {
84+
return {
85+
paths: [],
86+
fallback: false,
87+
}
88+
}
89+
90+
export default FileName
91+
```
92+
93+
## `nssp` - nextServerSideProps
94+
95+
```typescript
96+
export const getServerSideProps: GetServerSideProps = async (ctx) => {
97+
return {
98+
props: {}
99+
}
100+
}
101+
```
102+
103+
## `nsp` - nextStaticProps
104+
105+
```typescript
106+
export const getStaticProps: GetStaticProps = async (ctx) => {
107+
return {
108+
props: {},
109+
}
110+
}
111+
```
112+
113+
## `nspth` - nextStaticPaths
114+
115+
```typescript
116+
export const getStaticPaths: GetStaticPaths = async () => {
117+
return {
118+
paths: [],
119+
fallback: false,
120+
}
121+
}
122+
```
123+
124+
## `nip` - nextInitialProps
125+
126+
```typescript
127+
FileName.getInitialProps = async (ctx) => {
128+
return {
129+
130+
}
131+
}
132+
```
133+
134+
## `nimg` - nextImage
135+
136+
```typescript
137+
<Image src="" alt="" />
138+
```
139+
140+
## `napp` - nextApp
141+
142+
```typescript
143+
import type { AppProps } from 'next/app'
144+
145+
export default function MyApp({ Component, pageProps }: AppProps) {
146+
return <Component {...pageProps} />
147+
}
148+
```
149+
150+
## `ndoc` - nextDocument
151+
152+
```typescript
153+
import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
154+
155+
class MyDocument extends Document {
156+
static async getInitialProps(ctx: DocumentContext) {
157+
const initialProps = await Document.getInitialProps(ctx)
158+
return { ...initialProps }
159+
}
160+
161+
render() {
162+
return (
163+
<Html>
164+
<Head />
165+
<body>
166+
<Main />
167+
<NextScript />
168+
</body>
169+
</Html>
170+
);
171+
}
172+
}
173+
174+
export default MyDocument
175+
```
176+
177+
## `napi` - nextApi
178+
179+
```typescript
180+
import type { NextApiRequest, NextApiResponse } from 'next'
181+
182+
interface Data {}
183+
184+
export default async function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
185+
186+
}
187+
```
188+
189+
## `nmid` - nextMiddleware
190+
191+
```typescript
192+
import { NextResponse } from 'next/server'
193+
import type { NextRequest } from 'next/server'
194+
195+
export async function middleware(request: NextRequest) {
196+
197+
}
198+
199+
export const config = {
200+
matcher: '/about/:path*',
201+
}
202+
```

0 commit comments

Comments
 (0)