GithubHelp home page GithubHelp logo

aws-auth-example's Introduction

auth-example-aws

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your tests

npm run test

Lints and fixes files

npm run lint

aws-auth-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aws-auth-example's Issues

Using pre configured cognito user pool

Hi Erik,

Fantastic tutorial on youtube. Very helpful

I need to set this up with a preconfigured Cognito User pool. ie. I'm not running amplify push to generate the aws-exports.js.

I can't find any documentation about what this file looks like so I can create it manually.

Do you know how to grab this file from a cognito user pool?

Could you provide your config with the variables redacted so I can use my own?
I just need to know what the file looks like.

Thanks.

Simplified route guard

Hei @ErikCH,
I'm going through your Learn Vue.js with Authentication in 30 Minutes tutorial. Great work!

When I tried to use the route guard code from that video and this repository, it didn't seem to update the user variable in the promise .then callback. I was able to simplify the code and get it working with async/await:

import { Auth } from 'aws-amplify';

router.beforeResolve(async (to, from, next) => {
  if (to.matched.some(record => record.meta.requiresAuth)) {
    const user = await Auth.currentAuthenticatedUser();

    if (!user) {
      next({ path: "/login" });
    } else {
      next();
    }
  }
  // default to next
  next();
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.