We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please help, any idea how to solve? thx
// @Dependencies const { AuthenticationError } = require('apollo-server-express') const admin = require("../Server/client")
module.exports = async (context) => { // @Header const header = context.req.headers.authorization
// @validate if(!header) throw new Error('Musí sa uviesť hlavička overenia') // @token const token = header.split('Bearer ')[1] // @validate if(!token) throw new Error('Musí sa uviesť hlavička overenia') try { // @auth const auth = await admin.auth().verifyIdToken(token) // @user const user = await admin.firestore() .collection('users') .where('id', '==', auth.uid) .limit(1) .get() return user.docs[0].data() } catch(error) { throw new AuthenticationError(error) }
}
The text was updated successfully, but these errors were encountered:
Miss me await XO
Mutation: { async createPost(_, { body }, context) { try { // @user const user = await auth(context)
Sorry, something went wrong.
No branches or pull requests
Please help, any idea how to solve? thx
// @Dependencies
const { AuthenticationError } = require('apollo-server-express')
const admin = require("../Server/client")
module.exports = async (context) => {
// @Header
const header = context.req.headers.authorization
}
The text was updated successfully, but these errors were encountered: