Skip to content

Commit

Permalink
Adds params to generated auth.js getCurrentUser
Browse files Browse the repository at this point in the history
  • Loading branch information
dthyresson committed Jun 30, 2020
1 parent fd4f151 commit be1afec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { AuthenticationError } from '@redwoodjs/api'

export const getCurrentUser = async (jwt) => {
return jwt
export const getCurrentUser = async (decoded, { token, authType }) => {
return decoded
}

// Use this function in your services to check that a user is logged in, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const config = {

const adminApp = admin.initializeApp(config)

export const getCurrentUser = async (token) => {
export const getCurrentUser = async (decoded, { token, authType }) => {
const { email, uid } = await adminApp.auth().verifyIdToken(token)
return { email, uid }
}
Expand Down

0 comments on commit be1afec

Please sign in to comment.