11import React from 'react'
2- import Head from 'next/head'
32import Link from 'next/link'
3+ import Page from '../../components/page'
4+ import Layout from '../../components/layout'
45
5- export default class extends React . Component {
6+ export default class extends Page {
67
7- static async getInitialProps ( { query} ) {
8- return {
9- action : query . action || null ,
10- type : query . type || null ,
11- service : query . service || null
12- }
8+ static async getInitialProps ( { req , query} ) {
9+ let props = await super . getInitialProps ( { req } )
10+ props . action = query . action || null
11+ props . type = query . type || null
12+ props . service = query . service || null
13+ return props
1314 }
1415
1516 render ( ) {
1617 if ( this . props . action == 'signin' && this . props . type == 'oauth' && this . props . service ) {
1718 return (
18- < div className = "container" >
19- < Head >
20- < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity = "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossOrigin = "anonymous" />
21- </ Head >
19+ < Layout { ...this . props } navmenu = { false } >
2220 < div className = "text-center" >
2321 < h1 className = "display-4 mt-5 mb-3" > Unable to sign in with { this . props . service } </ h1 >
2422 < p className = "lead" > An account associated with your email address already exists.</ p >
@@ -39,35 +37,29 @@ export default class extends React.Component {
3937 </ div >
4038 </ div >
4139 </ div >
42- </ div >
40+ </ Layout >
4341 )
4442 } else if ( this . props . action == 'signin' && this . props . type == 'token-invalid' ) {
4543 return (
46- < div className = "container" >
47- < Head >
48- < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity = "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossOrigin = "anonymous" />
49- </ Head >
44+ < Layout { ...this . props } navmenu = { false } >
5045 < div className = "text-center" >
5146 < h1 className = "display-4 mt-5 mb-2" > Sign in link not valid</ h1 >
5247 < p className = "lead" > The sign in link you used is no longer valid.</ p >
5348 < p className = "lead" > < Link href = "/auth" > < a > Get a new sign in link.</ a > </ Link > </ p >
5449 </ div >
55- </ div >
50+ </ Layout >
5651 )
5752 } else {
5853 return (
59- < div className = "container" >
60- < Head >
61- < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity = "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossOrigin = "anonymous" />
62- </ Head >
54+ < Layout { ...this . props } navmenu = { false } >
6355 < div className = "text-center" >
6456 < h1 className = "display-4 mt-5" > Error signing in</ h1 >
6557 < p className = "lead" > An error occured while trying to sign in.</ p >
6658 < p >
6759 < Link href = "/" > < a > Home</ a > </ Link >
6860 </ p >
6961 </ div >
70- </ div >
62+ </ Layout >
7163 )
7264 }
7365 }
0 commit comments