-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Create profile page #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dist/**/*.js | ||
dist/**/*.js.map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not relevant to the profile page. This was renaming the cloud functions typescript build output to dist
, as lib
is a name commonly used in our architecture.
@@ -12,7 +12,7 @@ | |||
"engines": { | |||
"node": "12" | |||
}, | |||
"main": "lib/index.js", | |||
"main": "dist/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, relating to the cloud functions build naming
@@ -3,7 +3,7 @@ | |||
"module": "commonjs", | |||
"noImplicitReturns": true, | |||
"noUnusedLocals": true, | |||
"outDir": "lib", | |||
"outDir": "dist", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, relating to the cloud functions build naming
@@ -14,6 +14,6 @@ exports.onAccountCreation = functions.auth.user().onCreate(async (user) => { | |||
const usersCollection = admin.firestore().collection('users') | |||
await usersCollection.doc(uid).set({ | |||
email: email, | |||
summoners: [], | |||
summonerId: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured it was simpler to have a single summonerId for now and support multiple summoners later on
@@ -21,7 +21,11 @@ export default { | |||
}, | |||
|
|||
router: { | |||
middleware: ['auth'], | |||
middleware: ['auth', 'accountSetup'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how we enable the accountSetup middleware to run before the user can access a page
}, | ||
|
||
auth: { | ||
redirect: { home: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird, we aren't really using Nuxt's built in auth solution as far as I know. We were getting an error on the account setup redirect and this fixes is, as per:
nuxt-community/auth-module#731 (comment)
@@ -66,6 +70,7 @@ export default { | |||
onAuthStateChangedAction: 'account/onAuthStateChanged', | |||
}, | |||
}, | |||
firestore: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple enabling firestore database access 🔥
<h1>rito-plz</h1> | ||
</section> | ||
</div> | ||
<section class="Home"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some layout simplification on all the pages too, they all had an extra wrapping div that could be removed
}, | ||
}, | ||
created() { | ||
;(this as any).fetchData() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gross workaround for typescript issue. Vue methods aren't available in the created hook:
}, | ||
async fetchData() { | ||
this.isLoading = true | ||
await (this as any).fetchUser({ id: this.user.uid }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same workaround as above since vuex actions aren't predefined on the vue instance
This PR will scaffold the Profile page. It won't be able add all the functionality as we'll need to create an API to allow us to:
It also adds the logic to check that an account is setup, and if not to redirect them to the profile page.
