-
Notifications
You must be signed in to change notification settings - Fork 27
JS-1030 added oauth error logs #102
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
base: master
Are you sure you want to change the base?
Conversation
davehwly
left a comment
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.
fill in PR template with what & why
|
|
||
| if (!isAuthenticated || !!accessToken) return | ||
| if (!isAuthenticated || !!accessToken) { | ||
| errorLog('Not authenticate but access token exists.') |
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.
you can't tell if a token exists from this lazy evaluation can you?
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.
yeah but i think we can just say "not authenticated"?
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.
Are we adding nuxt-oauth - prefix to all the logs?
| } else { | ||
| errorLog("nuxt-oauth - session token not found") | ||
| return {} | ||
| } |
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.
If we remove the nesting would that improve readability?
if (!token) errorLog("nuxt-oauth - session token not found")
return token || {}
| await this.saveData({ accessToken: existingToken }) | ||
| } | ||
| } catch (e) { | ||
| errorLog("nuxt-oauth - saveData failed, clear the session") |
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.
Would logging the error also be helpful here?
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.
yeah I think @naveen-soho we need to make sure these errorLogs are actually error situations. so they should be instances where we're throwing or catching errors and also making sure the errors are logged too
so for example if they don't have an accessToken, is that a situation that should never occur? incase we need an errorLog. If it could reasonably occur normally we don't need to log
we want to make sure abnormal situations are logged and captured in raygun etc
|
|
||
| if (!isAuthenticated || !!accessToken) return | ||
| if (!isAuthenticated || !!accessToken) { | ||
| errorLog('Not authenticate but access token exists.') |
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.
Are we adding nuxt-oauth - prefix to all the logs?
What/Why?
Added missing/uncaught OAuth errors logs and issues like JS-1029 can be identified at an earlier stage