aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.43k stars 2.13k forks source link

NextJS SSR Aws Amplify Social Sign In #12436

Closed rush86999 closed 6 months ago

rush86999 commented 1 year ago

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

Authentication, GraphQL API

Amplify Categories

auth

Environment information

``` # Put output below this line System: OS: macOS 13.5.2 CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz Memory: 27.55 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 6.14.17 - ~/node_modules/.bin/npm pnpm: 8.6.12 - /usr/local/bin/pnpm Watchman: 2023.08.14.00 - /usr/local/bin/watchman Browsers: Chrome: 117.0.5938.149 Safari: 16.6 npmPackages: @ampproject/toolbox-optimizer: undefined () @apollo/client: ^3.8.6 => 3.8.6 @apollo/client/cache: undefined () @apollo/client/core: undefined () @apollo/client/dev: undefined () @apollo/client/errors: undefined () @apollo/client/link/batch: undefined () @apollo/client/link/batch-http: undefined () @apollo/client/link/context: undefined () @apollo/client/link/core: undefined () @apollo/client/link/error: undefined () @apollo/client/link/http: undefined () @apollo/client/link/persisted-queries: undefined () @apollo/client/link/remove-typename: undefined () @apollo/client/link/retry: undefined () @apollo/client/link/schema: undefined () @apollo/client/link/subscriptions: undefined () @apollo/client/link/utils: undefined () @apollo/client/link/ws: undefined () @apollo/client/react: undefined () @apollo/client/react/components: undefined () @apollo/client/react/context: undefined () @apollo/client/react/hoc: undefined () @apollo/client/react/hooks: undefined () @apollo/client/react/parser: undefined () @apollo/client/react/ssr: undefined () @apollo/client/testing: undefined () @apollo/client/testing/core: undefined () @apollo/client/utilities: undefined () @apollo/client/utilities/globals: undefined () @aws-amplify/ui-react: ^5.3.1 => 5.3.1 @aws-amplify/ui-react-internal: undefined () @babel/core: ^7.21.3 => undefined (7.23.2, ) @babel/plugin-proposal-export-namespace-from: ^7.18.9 => 7.18.9 @babel/plugin-transform-modules-commonjs: ^7.21.2 => 7.23.0 @babel/preset-env: ^7.20.2 => 7.23.2 @babel/preset-react: ^7.18.6 => 7.22.15 @babel/runtime: 7.15.4 @chakra-ui/icons: ^2.0.18 => 2.1.1 @chakra-ui/react: ^2.5.1 => 2.8.1 @edge-runtime/cookies: 4.0.2 @edge-runtime/ponyfill: 2.4.1 @edge-runtime/primitives: 4.0.2 @emotion/cache: ^11.10.5 => 11.11.0 @emotion/react: ^11.10.6 => 11.11.1 @emotion/server: ^11.10.0 => 11.11.0 @emotion/styled: ^11.10.6 => 11.11.0 @fontsource/roboto: ^4.5.8 => 4.5.8 @fortawesome/fontawesome-free: ^6.3.0 => 6.4.2 @hapi/accept: undefined () @lifeomic/attempt: ^3.0.3 => 3.0.3 @mswjs/interceptors: undefined () @mui/icons-material: ^5.11.11 => 5.14.15 @mui/material: ^5.11.14 => 5.14.15 @napi-rs/triples: undefined () @next/font: undefined () @next/react-dev-overlay: undefined () @opentelemetry/api: undefined () @radix-ui/react-slot: ^1.0.2 => 1.0.2 (1.0.0) @radix-ui/react-tooltip: ^1.0.6 => 1.0.7 @react-native-picker/picker: ^2.4.8 => 2.5.1 @rneui/base: ^4.0.0-rc.7 => 4.0.0-rc.8 @rneui/themed: ^4.0.0-rc.7 => 4.0.0-rc.8 @segment/ajv-human-errors: undefined () @sentry/nextjs: ^7.48.0 => 7.75.1 @shopify/restyle: ^2.4.1 => 2.4.2 @stripe/stripe-js: ^1.49.0 => 1.54.2 @tailwindcss/forms: ^0.5.3 => 0.5.6 @tailwindcss/typography: ^0.5.9 => 0.5.10 @types/commons-validator-js: ^1.0.1266 => 1.0.1266 @types/cors: ^2.8.13 => 2.8.15 @types/marked: ^4.0.8 => 4.3.2 @types/node: 17.0.35 => 17.0.35 (20.8.9) @types/qs: ^6.9.7 => 6.9.9 @types/react: ^18.0.28 => 18.2.32 @types/react-beautiful-dnd: ^13.1.4 => 13.1.6 @types/react-big-calendar: ^1.6.2 => 1.8.3 @types/react-burger-menu: ^2.8.3 => 2.8.5 @types/react-datetime-picker: ^3.4.1 => 3.4.1 @types/react-dom: ^18.0.11 => 18.2.14 @types/react-modal: ^3.13.1 => 3.16.2 @types/react-time-picker: ^4.0.3 => 4.0.3 @types/uuid: ^9.0.1 => 9.0.6 @types/xdate: ^0.8.32 => 0.8.34 @uiw/react-color-circle: ^1.1.3 => 1.4.3 @vercel/analytics: ^1.0.0 => 1.1.1 @vercel/nft: undefined () @vercel/og: undefined () HelloWorld: 0.0.1 acorn: undefined () ajv: ^8.12.0 => 8.12.0 (6.12.6, 4.11.8) amphtml-validator: undefined () anser: undefined () arg: undefined () assert: undefined () async-retry: undefined () async-sema: undefined () autoprefixer: ^10.4.13 => 10.4.16 aws-amplify: ^5.3.11 => 5.3.11 axios: ^1.3.4 => 1.5.1 (0.26.0) babel-loader: ^9.1.2 => 9.1.3 babel-packages: undefined () babel-plugin-module-resolver: ^5.0.0 => 5.0.0 babel-plugin-react-native-web: ^0.18.12 => 0.18.12 benchmark-uuid: undefined () browserify-zlib: undefined () browserslist: undefined () buffer: undefined () bytes: undefined () ci-info: undefined () class-variance-authority: ^0.7.0 => 0.7.0 classnames: ^2.3.2 => 2.3.2 (2.3.1) cli-select: undefined () client-only: 0.0.1 comment-json: undefined () commons-validator-js: ^1.0.1668 => 1.0.1668 compression: undefined () conf: undefined () constants-browserify: undefined () content-disposition: undefined () content-type: undefined () cookie: undefined () cors: ^2.8.5 => 2.8.5 cross-spawn: undefined () crypto-browserify: undefined () css.escape: undefined () daisyui: ^2.51.3 => 2.52.0 data-uri-to-buffer: undefined () date-fns: ^2.29.3 => 2.30.0 debug: undefined () devalue: undefined () domain-browser: undefined () edge-runtime: undefined () eslint: 8.15.0 => 8.15.0 eslint-config-next: 12.1.6 => 12.1.6 events: undefined () find-cache-dir: undefined () find-up: undefined () flowbite: ^1.6.4 => 1.8.1 framer-motion: ^10.2.3 => 10.16.4 fresh: undefined () get-orientation: undefined () github-slugger: ^2.0.0 => 2.0.0 glob: undefined () googleapis: ^112.0.0 => 112.0.0 got: ^12.6.0 => 12.6.1 (5.7.1) graphql: ^16.8.1 => 16.8.1 (15.8.0) graphql-ws: ^5.12.0 => 5.14.2 gray-matter: ^4.0.3 => 4.0.3 gzip-size: undefined () http-proxy: undefined () http-proxy-agent: undefined () https-browserify: undefined () https-proxy-agent: undefined () icss-utils: undefined () ignore-loader: undefined () image-size: undefined () is-animated: undefined () is-docker: undefined () is-wsl: undefined () jest-worker: undefined () json5: undefined () jsonwebtoken: undefined () loader-runner: undefined () loader-utils: undefined () lodash: ^4.17.21 => 4.17.21 (4.17.4, 3.10.1) lodash.curry: undefined () lru-cache: undefined () marked: ^4.2.12 => 4.3.0 mathjs: ^11.6.0 => 11.11.2 metro-react-native-babel-preset: ^0.76.0 => 0.76.8 (0.73.10) micromatch: undefined () mini-css-extract-plugin: undefined () nanoid: ^4.0.2 => undefined (4.0.2, , 3.3.6) native-url: undefined () neo-async: undefined () next: ^13.2.3 => 13.5.6 next-compose-plugins: ^2.2.1 => 2.2.1 next-mdx-remote: ^4.4.1 => 4.4.1 next-transpile-modules: ^10.0.0 => 10.0.1 node-fetch: undefined () node-html-parser: undefined () node-polyfill-webpack-plugin: ^2.0.1 => 2.0.1 ora: undefined () os-browserify: undefined () p-limit: undefined () patch-package: ^6.5.1 => 6.5.1 path-browserify: undefined () platform: undefined () postcss: ^8.4.21 => 8.4.31 postcss-flexbugs-fixes: undefined () postcss-modules-extract-imports: undefined () postcss-modules-local-by-default: undefined () postcss-modules-scope: undefined () postcss-modules-values: undefined () postcss-preset-env: undefined () postcss-safe-parser: undefined () postcss-scss: undefined () postcss-value-parser: undefined () postinstall-postinstall: ^2.1.0 => 2.1.0 process: undefined () punycode: undefined () qs: ^6.11.1 => 6.11.2 (6.4.0, 5.2.1) querystring-es3: undefined () raf: ^3.4.1 => 3.4.1 raw-body: undefined () react: ^18.2.0 => 18.2.0 react-beautiful-dnd: ^13.1.1 => 13.1.1 react-big-calendar: ^1.6.9 => 1.8.4 react-builtin: undefined () react-burger-menu: ^3.0.9 => 3.0.9 react-datetime-picker: ^4.2.0 => 4.2.1 react-dom: ^18.2.0 => 18.2.0 react-dom-builtin: undefined () react-dom-experimental-builtin: undefined () react-experimental-builtin: undefined () react-gtm-module: ^2.0.11 => 2.0.11 react-icons: ^4.8.0 => 4.11.0 react-is: 18.2.0 react-lite-youtube-embed: ^2.3.52 => 2.3.52 react-modal: ^3.16.1 => 3.16.1 react-native: ^0.71.4 => 0.71.14 react-native-safe-area-context: ^4.5.1 => 4.7.4 react-native-star-rating-widget: ^1.7.1 => 1.7.2 react-native-svg: ^13.8.0 => 13.14.0 react-native-toast-message: ^2.1.6 => 2.1.7 react-native-vector-icons: ^9.2.0 => 9.2.0 react-native-web: ^0.18.12 => 0.18.12 react-refresh: 0.12.0 react-select: ^5.7.2 => 5.7.7 react-server-dom-turbopack-builtin: undefined () react-server-dom-turbopack-experimental-builtin: undefined () react-server-dom-webpack-builtin: undefined () react-server-dom-webpack-experimental-builtin: undefined () react-textarea-autosize: ^8.4.1 => 8.5.3 regenerator-runtime: 0.13.4 rehype-slug: ^5.1.0 => 5.1.0 remark-gfm: ^3.0.1 => 3.0.1 rrule: ^2.7.2 => 2.7.2 sass: ^1.58.3 => 1.69.4 sass-loader: undefined () scheduler-builtin: undefined () scheduler-experimental-builtin: undefined () schema-utils: undefined () semver: undefined () send: undefined () server-only: 0.0.1 setimmediate: ^1.0.5 => 1.0.5 () shell-quote: undefined () socket.io-client: ^4.7.1 => 4.7.2 (4.4.0) source-map: undefined () stacktrace-parser: undefined () stream-browserify: undefined () stream-http: undefined () string-hash: undefined () string_decoder: undefined () strip-ansi: undefined () stripe: ^11.15.0 => 11.18.0 superstruct: undefined () tailwind-bootstrap-grid: ^5.0.1 => 5.0.1 tailwind-merge: ^1.14.0 => 1.14.0 tailwindcss: ^3.2.7 => 3.3.5 tailwindcss-animate: ^1.0.6 => 1.0.7 tar: undefined () terser: undefined () text-table: undefined () timers-browserify: undefined () tty-browserify: undefined () typescript: ^4.9.5 => 4.9.5 ua-parser-js: undefined () undici: undefined () unistore: undefined () util: undefined () uuid: ^9.0.0 => 9.0.1 (3.4.0, 8.3.2, 3.1.0, 2.0.3) vm-browserify: undefined () watchpack: undefined () web-vitals: undefined () webpack: undefined () webpack-sources: undefined () ws: undefined () zod: undefined () npmGlobalPackages: @aws-amplify/cli: 12.7.1 corepack: 0.19.0 npm: 9.8.1 ```

Describe the bug

User is not successfully logged in via Social Sign In on the web using Nextjs and ssr: true with aws amplify. There are no error messages just back to the login screen. There are no cookies set.

Expected behavior

  1. User should be successfully logged in and cookies set.

Reproduction steps

  1. Setup Next.JS
  2. Setup Amplify Social Sign-In as per instructions
  3. set ssr: true and add redirect urls to amplify.configure
  4. The user clicks on Google Sign in and redirects to Google
  5. User successfully signs in and get redirected back
  6. User is not logged in successfully
  7. Browser does not show any Cookies set but a successful 200 status response

Code Snippet

// Put your code below this line.

import React, { useState, useEffect } from 'react'
import {
  Pressable,
  TouchableOpacity,
  ActivityIndicator,
 } from 'react-native'

// import Amplify, {  } from 'aws-amplify'
import { Auth } from 'aws-amplify';
import { useToast } from '@chakra-ui/react'

import Box from '@components/common/Box'
import Text from '@components/common/Text'
import Button from '@components/Button'
import TextField from '@components/TextField'

import { palette } from '@lib/theme/theme'
import SIZES from '@lib/theme/sizes'
import { FaGoogle, FaApple } from "react-icons/fa";

import { useRouter } from 'next/router'
import checkSession from '@lib/session'
import { NextApiRequest } from 'next'

export async function getServerSideProps({ req }: { req: NextApiRequest}) {
  const sub = await checkSession(req)

  if (sub) {
    return {
      redirect: {
        destination: '/',
        permanent: false,
      },
    }
  }

  return {
    props: {}
  }
}

 function UserLogin() {
    const [email, setEmail] = useState<string>('')
    const [password, setPassword] = useState<string>('')
    const [user, setUser] = useState<any>()
    const [passChallenge, setPassChallenge] = useState<string>('')
    const [isLoading, setIsLoading] = useState<boolean>(false)

    // const dark = useColorScheme() === 'dark'
    const toast = useToast()
    const router = useRouter()
      // check if user already logged in and confirmed
    useEffect(() => {
      async function checkLoggedIn() {
        try {
          if (!Auth) {
            return
          }
          const { payload: { sub } } = (await Auth?.currentSession())?.getIdToken()
          if (sub) {
            router.push('/')
          }
        } catch(e) {
          console.log(e, ' unable to auth')
        }
      }
      checkLoggedIn()
    }, [router])

   const onEmailChange = (value: string) => setEmail(value)

   const onPasswordChange = (value: string): void => setPassword(value)

   const onSignIn = async () => {
     setIsLoading(true)
     if (!email) {
       toast({
         status: 'error',
         title: 'Email empty',
         description: 'Email cannot be empty',
         duration: 9000,
         isClosable: true,
       })
        setIsLoading(false)
       return
     }

     if (!password) {
       toast({
         status: 'error',
         title: 'Password empty',
         description: 'Password cannot be empty',
         duration: 9000,
          isClosable: true,
       })
        setIsLoading(false)
       return
     }
     try  {
       const user = await Auth.signIn(email, password)

       // console.log(user, ' this is signIn')

      if (user.challengeName === 'NEW_PASSWORD_REQUIRED') {
        setUser(user)
      }

       router.push('/')
     } catch(e: any) {
       console.log(e, ' unable to sign in')
       if (e.code === 'UserNotConfirmedException') {
        await Auth.resendSignUp(email)
        toast({
          status: 'info',
          title: 'You are not confirmed',
          description: 'Code has been resent for confirmation',
          duration: 9000,
          isClosable: true,
        })
        setIsLoading(false)
        router.push('/User/Register/UserConfirmRegister')
        return
      }

      toast({
        status: 'error',
        title: 'Oops...',
        description: `${e.message}`,
        duration: 9000,
          isClosable: true,
      })
     }
     setIsLoading(false)
   }

   const onNewPasswordRequired = async () => {
     setIsLoading(true)
     try {
       await Auth.completeNewPassword(
         user,
         passChallenge,
         {
           email,
         }
       )

     } catch(e) {
       console.log(e, ' unable to confirm new password required')
       toast({
          status: 'error',
          title: 'Could not confirm',
          description: 'Unable to confirm new challenge password',
          duration: 9000,
          isClosable: true,
       })
     }

     setIsLoading(false)
   }

   const navigateToForgotPass = () => router.push({ pathname: '/User/Login/UserForgotPassword'})

   const navigateToRegister = () => router.push({ pathname: '/User/Register/UserInitialRegister'})

  if (isLoading) {
    return (
        <Box backgroundColor="primaryCardBackground" flex={1} justifyContent="center" alignItems="center" minHeight="70vh" style={{ width: '100%'}}>
          <ActivityIndicator size="large" color={palette.white} />
        </Box>
    )
   }

   if (user?.challengeName === 'NEW_PASSWORD_REQUIRED') {
     return (
       <Box flex={1} justifyContent="space-around" alignItems="center">

            <TextField
              label="New Password Challenge"
              value={passChallenge}
              onChange={(e: { target: { value: string } }) => setPassChallenge(e?.target?.value)}
            />
            <Box pt={{ phone: 'm', tablet: 'l' }}>
              <Button onClick={onNewPasswordRequired}>
                Login with New Password
              </Button>
            </Box>

        </Box>
     )
   }

   return (
     <Box flex={1} justifyContent="center" alignItems="center" minHeight="70vh">

         <Box justifyContent="space-around" alignItems="center">
           <Box p={{ phone: 'm' , tablet: 'l' }}>
             <TextField
                label="Email"
                value={email}
                onChange={(e: { target: { value: string } }) => onEmailChange(e?.target?.value)}
                autoComplete="email"
                autoCapitalize="none"
                type="email"
             />
             <TextField
               label="Password"
               type="password"
               value={password}
               onChange={(e: { target: { value: string } }) => onPasswordChange(e?.target?.value)}
               autoCapitalize='none'
             />
             <Box flexDirection="row" justifyContent="flex-start">
               <button className="btn btn-link" onClick={navigateToForgotPass}>
                  Forgot Password?
               </button>
             </Box>
           </Box>
           <Button onClick={onSignIn}>
             Log In
           </Button>
           <Box p={{ phone: 'm', tablet: 'l' }} flexDirection="row" justifyContent="center" alignItems="center">
             <Text variant="optionHeader">
               Don&apos;t have an account?
             </Text>

             <button className="btn btn-link" onClick={navigateToRegister}>
               Sign up!
             </button>

           </Box>
         </Box>
       <Box justifyContent="space-around" alignItems="center">
         <div className="pt-3">
           <Box pt={{ phone: 'm', tablet: 's' }}>
             <Pressable
               style={{
                 backgroundColor: '#DB4437',
                 borderWidth: 0,
                 borderRadius: SIZES.BASE * 2,
                 width: 275,
                 height: 44,
                 justifyContent: 'center', flexDirection: 'row', alignItems: 'center',
               }}
               onPress={() => {

                 Auth.federatedSignIn({
                   provider: 'Google',
                  })
                }}
             >
               <TouchableOpacity onPress={() => {

                 Auth.federatedSignIn({
                   provider: 'Google',
                 })
              }} style={{ justifyContent: 'center', flexDirection: 'row', alignItems: 'center' }}>
                 <Box flexDirection="row" justifyContent="center" alignItems="center">
                   <FaGoogle
                     name="google"
                     size="2em"
                     color={palette.white}
                     style={{ marginRight: 22 }}
                   />
                   <Text variant="google">
                     Sign in with Google
                   </Text>
                 </Box>
             </TouchableOpacity>
             </Pressable>
           </Box>
         </div>
         <div className="pt-3">
           <Box pt={{ phone: 'm', tablet: 's' }}>
             <Pressable
               style={{
                 backgroundColor: palette.black,
                 borderWidth: 0,
                 borderRadius: SIZES.BASE * 2,
                 width: 275,
                 height: 44,
                 justifyContent: 'center', flexDirection: 'row', alignItems: 'center',
               }}
               onPress={() => {

                 Auth.federatedSignIn({
                   provider: 'Apple',
                })
              }}
             >
               <TouchableOpacity onPress={() => {

                 Auth.federatedSignIn({
                   provider: 'Apple',
                 })
              }} style={{ justifyContent: 'center', flexDirection: 'row', alignItems: 'center' }}>
                 <Box flexDirection="row" justifyContent="center" alignItems="center">
                   <FaApple
                     name="apple"
                     size="2em"
                     color={palette.white}
                     style={{ marginRight: 22 }}
                   />
                   <Text variant="apple" style={{ color: palette.white }}>
                     Sign in with Apple
                   </Text>
                 </Box>
               </TouchableOpacity>
             </Pressable>
           </Box>
           </div>
         </Box>
     </Box>
   )

 }

 export default UserLogin

with session.ts file

import { Amplify, withSSRContext } from "aws-amplify";
import { NextApiRequest } from 'next';
import awsExports from "src/aws-exports";

const isLocalhost = Boolean(
    (typeof window !== 'undefined' ? window.location.hostname === 'localhost' : false) ||
      // [::1] is the IPv6 localhost address.
      (typeof window !== 'undefined'  ? window.location.hostname === '[::1]' : false) ||
      // 127.0.0.1/8 is considered localhost for IPv4.
      (typeof window !== 'undefined' ?  window.location.hostname.match(
        /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
      ) : false)
  );

// Assuming you have two redirect URIs, and the first is for localhost and second is for production
const [
    mobileRedirectSignIn,
    localRedirectSignIn,
    productionRedirectSignIn,
  ] = awsExports.oauth.redirectSignIn.split(',')

const [
    mobileRedirectSignOut,
    localRedirectSignOut,
    productionRedirectSignOut,
  ] = awsExports.oauth.redirectSignOut.split(',')

Amplify.configure({
    ...awsExports,
    ssr: true,
    oauth: {
      ...awsExports.oauth,
      redirectSignIn: `${typeof window !== 'undefined' ? `${isLocalhost ? localRedirectSignIn : productionRedirectSignIn}` : 'http://localhost:3000'}/`,
      redirectSignOut: `${typeof window !== 'undefined' ? `${isLocalhost ? localRedirectSignOut : productionRedirectSignOut}` : 'http://localhost:3000'}/`,
    },
  });

export default async function checkSession(req: NextApiRequest) {
    // Notice how the server uses `API` from `withSSRContext`, instead of the top-level `API`.
    const { Auth } = withSSRContext({ req })
    try {
        const { payload: { sub } } = (await Auth.currentSession()).getAccessToken()

        return sub
    } catch (e) {
        console.log(e, ' unable to get logged in user sub')
        return null
    }

    return null
}

Log output

``` // Put your logs below this line ```

aws-exports.js

/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = {
    "aws_project_region": "us-east-1",
    "aws_cognito_identity_pool_id": "us-east-1:xxxx,
    "aws_cognito_region": "us-east-1",
    "aws_user_pools_id": "xxxx",
    "aws_user_pools_web_client_id": "xxx",
    "oauth": {
        "domain": "xxxxx-prod.auth.us-east-1.amazoncognito.com",
        "scope": [
            "phone",
            "email",
            "openid",
            "profile",
            "aws.cognito.signin.user.admin"
        ],
        "redirectSignIn": "atomiclife://,http://localhost:3000/,https://app.atomiclife.app/",
        "redirectSignOut": "atomiclife://logout,http://localhost:3000/,https://app.atomiclife.app/",
        "responseType": "code"
    },
    "federationTarget": "COGNITO_USER_AND_IDENTITY_POOLS",
    "aws_cognito_username_attributes": [
        "EMAIL"
    ],
    "aws_cognito_social_providers": [
        "FACEBOOK",
        "GOOGLE",
        "APPLE"
    ],
    "aws_cognito_signup_attributes": [
        "EMAIL"
    ],
    "aws_cognito_mfa_configuration": "OFF",
    "aws_cognito_mfa_types": [
        "SMS"
    ],
    "aws_cognito_password_protection_settings": {
        "passwordPolicyMinLength": 8,
        "passwordPolicyCharacters": []
    },
    "aws_cognito_verification_mechanisms": [
        "EMAIL"
    ],
    "aws_appsync_graphqlEndpoint": "https://xxxxx.appsync-api.us-east-1.amazonaws.com/graphql",
    "aws_appsync_region": "us-east-1",
    "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS",
    "aws_appsync_apiKey": "xxxxxx",
    "aws_user_files_s3_bucket": "xxxxx-prod",
    "aws_user_files_s3_bucket_region": "us-east-1"
};

export default awsmobile;

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

cwomack commented 1 year ago

Hello, @rush86999 👋. I'm working on reproducing this issue and wondering if you could share maybe a screenshot of what the request/response looks like to Cognito when attempting to do the federated sign in. Would you mind capturing that and sharing it? Also, can you see if removing "phone" from the scope array changes the behavior?

rush86999 commented 1 year ago

@cwomack When you say the request/response, do you mean from under the network tab?

Screenshot 2023-10-27 at 3 49 42 PM
rush86999 commented 1 year ago

You can test it here as well: https://app.atomiclife.app/User/Login/UserLogin

rush86999 commented 1 year ago

Should I try to remove phone scope via amplify update auth?

rush86999 commented 1 year ago

I also have Hub.listen event listener inside _app.ts file if you need to see the code for this let me know.

rush86999 commented 1 year ago

Do I manually remove the phone scope from the Cognito console? Is there an option via the cli?

rush86999 commented 1 year ago

response does not show up but here's the payload:

access_type: offline
client_id: 159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com
redirect_uri: https://fireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com/oauth2/idpresponse
response_type: code
scope: openid email profile
state: H4sIAAAAAAAAAE2SW4_aMBCF_4ufSciVEN66hCWwlEuzbEKrCtmxTQxx7s6t6n-vqdRVn3yOfObzaMa_AAQLIGqFwLpR9CtycHnu_U0KJgDJm3We31IiTSzNTC_ZTVhGOUPIrdKqvRclNR23KGUAy0DSNEW9mE5hUaiwyTmLU0aJKu10KiNERuIcP3H0f_YNLH6AIsmzpyEcsufreUEyhqUoqpyyvznY1Wqc3zLW5GrN5JmpoiaVCjFnGfg5AYmkmihzvNPF0szZ_cswhh0X_SMNB3oOfbwvtpLDZOxEro4eHDZ6NDLPQH4E98k1LJ3rN_pyMIuhxWbUn8O-P2xkxV1WBIY9k_Ih5db4_nI_rdyxod12qAd7-dqL1yw-thzl8dCtdm3JhSGiTSXeo6h984hADvpIBPYDXiXe-mMZOftq5ZDYHjU7rY_Iby6k-NoEmJb43a6UyBPbXXY80Yo_aOe57fxhWKMbr0M_aHzqkk73Lt3baB72uxAF7ZUvneH0thT6ZVluGkh6uKsDS3acyo4pq4hcg-kYhgGRpnwKOV2sQtEk6ucnUCGHY579m3SccwnhYKHP3Lntuq41l0sBCwrTmkxA9aTPqYmMWawgommKZVhYQaZGFapjqEMt1qFDwO8_eNDvZmwCAAA.H4sIAAAAAAAAAAEgAN__-GfYNe1shpTrWJb2tZJMkersYjCnu8mDxCe_Jlu0Kv3RUUigIAAAAA.4
service: lso
o2v: 2
theme: glif
continue: https://accounts.google.com/signin/oauth/consent?authuser=unknown&part=AJi8hANsy65wPbWrrbmh4M5QvtD9HyMvYt2fzTyIslyF0eV_9HRhvPPYMGhjv-Qj8PnniD8W_byzVXZKHTFE9fWFJOj8nQjz2TRm7BtPIZv3RqmTm6xDN5cvwH2JHjaGWuBw96IXO6Xy8hTwcUapq239huCCZVDX1pZULYzxZjVwnw0zCHOaIou4HJjtu7r_NVBJRTKsIbI5b7iqN_3Mareq9226fIv4dTH84yI-lBPWL-Qc_S2bk42FaeI8K3dS3zkAikv-vlwi81qFoa_h_CM6zQDxDsDFcU_Q968JynxCDv93ory1Jd31t-N5DITFuXI-2zOAz1kkjZ6QbuPSL6ZUIFNIyG71flzOmENeEAh_jg_0RAWmivfDidAm4SLaBqQWPGj3wc_-IBGCAW_VQqLRcna2r2XnW1I2-33BfORNhLXbvBIilWYeoAnfI_Ta1VMfXMGY8ZkM7cHD1QCuNz1r2oU0_kCczY8KW7XzJgzOell5u3Bd8yO052Ed8Od4hyykKLk5AM4W4DWZ7wUCnIDC1P051govwQ&as=S-1744716102%3A1698599948198764&client_id=159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com&theme=glif#
f.req: ["AEThLlzp3afSzhLZCzobLkJx9g5CsBWO1-7oJvWEvpEGOgV1GpMduNNxTBq4hvSsbqpLam0-ghVg45kVtyfaHmW2MqVEnr2AnDZithIwQaAzs9w-7RKWObQlcJtQQ1QvKDJypRRA-7LTtP8-gKyiMWUaMMQSG8cj6ri_nSKkBUro6S7yAwva_5gkr-2oEy1qYVTo8MIsRcuIDT1BXlTVC8It9NemcjzrVVTykcBnmIflAkM2UbkwkfeQBzbJ4AXEZmH1hgR5FSRuPfujzZ2nnGtpjwZSt37l_U7umAfK5RBm77SjhDto4CCgKM2E7Ja0WLDh7en0HJOLaWZluGk8n1tNznGSZ9yL5OE8Jy6gcVKz1BqJ2vQIZ4q2sw617Mk06HHmeGn-aQ-4-TGGb51iwdXkXm9epIDs5Cvw2plbXkqck37ePNSMiEMHro1HgRkqKoJm7tvI-lC5Q3rKTU9u-ncwR5yUydHFJnmShO90nWWhe0N4_YGEVb2hZajY8cHywpeP2GA65B9lKuJ0lpkUCHGZawj54yWjH_oBmz9m904d2eaCkWF05dm8DprJ9P0m3OAvtzK7uKMgbRxDwFu7TnTQaciOAL-1igBYJTjjeWZjQ5RIhAs8l3zUeUHo2a6-BvjvaMDiP_CbMjZIuo0jnFo6MqyAU5sp2R56RZKQujcGEO2xkSCsEdBrACwJIjfFNet3Oo2wy1G-GWX_s_l2_0TzrknWAvyEA3kdtCywafHRHtmwLkUF7M_Tx6OR_99XXjX2wC7XMB_YhPkXKf_fGjAXePeZDTTJ0ZpLywtbTXqYgIgR6muQYyJinz4qd_E9ar3qdJL3F0PKpRZz88NwuFDn1bnSI69_MYjKL0u4-DaLhR7wzJoxsrqLBSha5EcX8cOC-bf6Ypr8E6PfmMg417hmvBaonsuRkB4mMUZaYppZviHVoY5aONkOW_QplSb2bClbbYSBosWPgzAQ71TYG_wNUltT-iVMJUpipcKL1eCWf499VVhJDQDM-VkNiWrVBVLpiM_4Ga_P9f5NMH7HWwtIVR2EiWE8G3Sb1P6eRbOmmr8TQwJSRD8ajdBdkU885QWVjAqbTmXv_YYHkQn5Ipxv0ZGWbwVIG8geCCoVtsYdvOogRErVEzpysf-XzLp6kSWop5wtCIV_FtKUbP_yH5gzpTfHbeb42sEo835MfpVnZr35Bm0Q8G_N7zteS2QJHzF8i6JEGdzMjQVzk51Ogqv5Sr7Nmqmkrmv86LElx8yiX8sKKsYtRRRRfe00OUZrykTpC2DW9HaoAyNHMQqHsIBwmW4yw9das5xorMciSD-bNSu4BnmkWq47tCvlgReKpWsyOHHL3PdOzgA2wYCLGwXswzMZgrnK-6MOV2Cwri_hlNUFsiaBNGAmCk_wQnMcNUyTNr83l4gJsx7nLxT7aB4zzAsKyBIxiGgpiJ2XsgkCugFJf4vZKQ1h8y6r1kISlSaMXFTKFmhD941L8YKzi5nBVdMLRO3tkL-rxshyW7uxfp0N_O63pG-RU3uIyLZLGEi5imjp8zBApf3fyRYaZibnoJFz5XUnkiErGTZ2c824nSc8UA6ba7sKd_AnaT8wA2rXiE4saEQS1gy6SwLZug2ZB9pZax0Aa1WQ4jx_PYDuflmCACvhkmb7b9C5GtM8KsDRHdRTGJpyF6ZK___3p7aw-ie7iY5Smy1hVuNOpbiTyBSGC8cF8ZgkIGsFPTc1akWcn-8LWaqYnHmb-QsX4IB6YUc8OgR0c_AR5zF1XqToQSfzWcXL91JtKuXLoXTXqVXsC_PAWhNS-VSB7Qa5VGHEwaY0L8gIXXO4LYVBiLCo4rzeZtq-TuJ6JufydUh-iKpEekPHrgQQeSUp-bLQJ2FT9a69ej6vpJN3_jVMXlUfaDg6_sIovfJ0WKNDyJFHpYzP0XR2wRrBAchJhEYuZRrzsD_5yFw43gX9-IZTufX-UCI_o9UfPIbQf7akrsX24MUXR36sJ7AchM8ERLhRGwp1nngEp_hWmVnro7_mdm2NiO7tfnc36FOznxA070UKzAhsWQkp3jgLit7f5aRu4o--foZKjC2MPlHHCR2ktRdHMyGpUitN44uNJyVNTYUVtOaPn9htsciKC9VpP9P5bfkJafmdEoA520YiTkVYseuywofkKGg4Aj2mAWCGRA3uVu2Pu7ZkYLLOT1ZVTG1qboPmpzYN9QdgcAwpFwzE0tSTObONcBryhkmUDuR6YJzIxEXbIrWX5tXvYv3udTZnFcc4aMRV9dBx-swpLn7_3yQh_iBqzW7hdrpJRjl10dNP1veliHjhkCvJ0YaTkfXivA2M6adLnH3GXzdx-fAEKNymOEwH6aSOtfqghHtbBxBhC5YwqZJne0h0yPvK387MnLsDB3eBNh3k-uTSFMBZx0xRW7vIb3sZ0cjbxmAMGsRLUnNyvnnaHxMXaLk271h_5dlZmdj9P9T7Yw",0,0,null,[null,null,[2,1,null,1,"https://accounts.google.com/signin/oauth?client_id=159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Ffireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com%2Foauth2%2Fidpresponse&scope=openid+email+profile&response_type=code&state=H4sIAAAAAAAAAE2SW4_aMBCF_4ufSciVEN66hCWwlEuzbEKrCtmxTQxx7s6t6n-vqdRVn3yOfObzaMa_AAQLIGqFwLpR9CtycHnu_U0KJgDJm3We31IiTSzNTC_ZTVhGOUPIrdKqvRclNR23KGUAy0DSNEW9mE5hUaiwyTmLU0aJKu10KiNERuIcP3H0f_YNLH6AIsmzpyEcsufreUEyhqUoqpyyvznY1Wqc3zLW5GrN5JmpoiaVCjFnGfg5AYmkmihzvNPF0szZ_cswhh0X_SMNB3oOfbwvtpLDZOxEro4eHDZ6NDLPQH4E98k1LJ3rN_pyMIuhxWbUn8O-P2xkxV1WBIY9k_Ih5db4_nI_rdyxod12qAd7-dqL1yw-thzl8dCtdm3JhSGiTSXeo6h984hADvpIBPYDXiXe-mMZOftq5ZDYHjU7rY_Iby6k-NoEmJb43a6UyBPbXXY80Yo_aOe57fxhWKMbr0M_aHzqkk73Lt3baB72uxAF7ZUvneH0thT6ZVluGkh6uKsDS3acyo4pq4hcg-kYhgGRpnwKOV2sQtEk6ucnUCGHY579m3SccwnhYKHP3Lntuq41l0sBCwrTmkxA9aTPqYmMWawgommKZVhYQaZGFapjqEMt1qFDwO8_eNDvZmwCAAA.H4sIAAAAAAAAAAEgAN__-GfYNe1shpTrWJb2tZJMkersYjCnu8mDxCe_Jlu0Kv3RUUigIAAAAA.4&access_type=offline",null,[],4,[],"GeneralOAuthFlow",null,[],1],10,[null,"159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com",[],"!ChRPU0ZmTWNtRlFtMk53Q3RTc3FsLRIfODVrMks0RWtMcGtaWUlreWNoTjIyM1FjX1NUSHR4Zw∙AHkTZLMAAAAAZT_ljI_8t_BY9-CMm8S17TKM1CGD7VVH",null,null,null,null,null,null,null,"https://fireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com","S-1744716102:1698599948198764",0,null,null,null,null,[5,"77185425430.apps.googleusercontent.com",["https://www.google.com/accounts/OAuthLogin"],null,null,"CB274AA5-4769-423F-9F3B-A21B78604F48",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,5,null,null,[],null,null,null,null,[]],null,null,null,14,null,null,[],1,null,null,null,[[null,9315],[null,202],[null,204]],null,1,null,null,1],null,null,null,1,null,null,null,null,null,null,null,null,[],null,null,3]]
bgRequest: ["oauth-account-chooser","<ZKhqqPACAAZcS_mNfEuNbRwkfhaRD3T0ADQBEArZ1JsHFBXsZyq0f8RAbsi4dXeBrQSLSq9jPUOpaRJ-3sIgY6nNbZscTVwTqIUcGDUlzQAAAtOdAAAAKqcBB1YEasZNzHmRsf5ThdmksjFUlkq_qE6UC0g4IkNKa4_Sir9IRIonPWLvfWfRD7G69s_3c2GypxziUeui5cu3ea__xnacGQZQW-pJGo5ZeohtgrT_2nBxf8j730nofa-oZ3BggaC82G8wrPiS1pr9KfVH-k9C3zG3HhVbkC6WWvje2UAJfXKaRUQG164UN1NB918bTI_4zXecqsgDwcQ8Ucml7N1KWp50HhgNApudGRZPCi5B2SHwX8J0QEcRHuqdSLozoz0vLyd-FNSWYulBljfp7m9ctoNdUic56W0mRmj9RluH0rzt2dh0xXeUoscvviP-iv-nYJrME2AAHAHa2sQZwPYKyDdy3wPrrmg6yESTH1F26id7vuqXeYZR_qj8XkQHzahYzDI-O1PRrrRIHC5kdh34swpQgghE6qmbZvwCxGMacZkqcSV0IpstDFIpE-sJU-S4foBeA-eIEHmuZsJemNnJ_JYd0gM0O9Zs6V3w2U4rW7mhCnW7zBoxuglVJmHp2jRKYrK2puUWv6kRZPYDHFwn8uc7_noFXwRZBPEYePfAbExmvAKK5PnAiUWzbZm_6MNIHQ6LZ6hIDwHO8ZGZbu4NI1V9sSUqElWS0Z8dQLLR14wAiMW_bITMD9gvWcHKGqH41VBGLo7tlwBZgjfPwaJ-YjzpS_DNEIY3mVbXT81erHDCvmb432RaIp6gGs7VRU-FkkX96bdGsb3YFJTLbqm7zIBA_1mPJGlMVcdfyYx50kcLovIcealSrbV4HQTBb7mVPuhMzvIUKYTCU53baP55owO5e8QxeeDNDop1hIcfdMfgUs7dddsuPDLZTLiORWHLLeEkARxn2rTW3vb5RUO2VNzmX1AOEFbl1yFg1CvuN64yYHg_1XHL03h0bSkAU7EltQkAARoecdwpxraxOMZtD699-U9uRMJYXXbNIE44u2re66pgBQVJP3DQC3_BBEFsToQtcWxWwAPBcFl5Zk_x02NWt1VkndMkdUXJrmLZQBu5RetHhkpopr5dExCgNSs4zdsEtdfAe-H4HdRYs6bYO-5nbJEziF5eWc98JjNLP1UX-t6pqF1OB7NUjmSihtF2e_K3aP5IcYsb2eJqViFZ-efqDiP0Z50GXkpJXqrPOY8vhnNbrg-QrJjczyMVPg2GloP5DAPYX5Irvcg9XDkaLBcgaa6Exvzexd0OdwC3-fWyqQPcbqU101X3LgFyg2VUD6z0OlS8EE3oa2FKYIafMb_o4KddSpcxrqX2E4Smpw9FO36oeD0DbAAeHCwj9MaC78G5MdoNSMz1RTrLkNPY8o8FlQ3_VfEUpDsrZHWw0wfLOVMGrl1SePaST0fg6zpdn2pt2MrI_xNLo6LJgXMzS3McGvYg8Hpd33LbviSLVB87lHIYQql3VtWMAQ0WoqS2syhj710eg8c_v2ovEplxxIDi4I7-J9IGwB6_DjjStD-YvScDinMwEhB97HgOTc4bds7DEVe3BLd3rIytItkqo92_VXY_FPPU"]
at: AFoagUVxa_ZG-dCv6FdSu9NTwBS2tk424A:1698599948291
azt: AFoagUVxa_ZG-dCv6FdSu9NTwBS2tk424A:1698599948291
cookiesDisabled: false
deviceinfo: [null,null,null,[],null,"CA",null,null,null,"GeneralOAuthFlow",null,[null,"159344105155-l3g18r35mrk7js66pin9lrdjs34k99k0.apps.googleusercontent.com",[],"!ChRPU0ZmTWNtRlFtMk53Q3RTc3FsLRIfODVrMks0RWtMcGtaWUlreWNoTjIyM1FjX1NUSHR4Zw∙AHkTZLMAAAAAZT_ljI_8t_BY9-CMm8S17TKM1CGD7VVH",null,null,null,null,null,null,null,"https://fireapp37222ab0-37222ab0-prod.auth.us-east-1.amazoncognito.com","S-1744716102:1698599948198764",0,null,null,null,null,[5,"77185425430.apps.googleusercontent.com",["https://www.google.com/accounts/OAuthLogin"],null,null,"CB274AA5-4769-423F-9F3B-A21B78604F48",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,5,null,null,[],null,null,null,null,[]],null,null,null,14,null,null,[],1,null,null,null,[[null,9315],[null,202],[null,204]],null,1,null,null,1],null,null,null,null,1,null,0,1,"",null,null,1,1]
gmscoreversion: undefined
flowName: GeneralOAuthFlow
checkConnection: youtube:599:0
checkedDomains: youtube
(empty)
rush86999 commented 1 year ago

Ok so I removed the phone option.

rush86999 commented 1 year ago
Screenshot 2023-10-31 at 5 28 26 PM Screenshot 2023-10-31 at 5 28 07 PM

more info

cwomack commented 1 year ago

Hey @rush86999, thank you for the additional context and seeing if the removal of the phone scope changed anything. If you refresh after the redirect from Google, does it show that there's a session? Are you using the default localStorage for cookies as well?

rush86999 commented 1 year ago

Hi @cwomack, if the default is localStorage then yes as I have not changed any settings for localStorage and whatever the default behavior is active. Here are more screenshots for Cookies. Not sure what to look for here.

Screenshot 2023-11-09 at 2 38 27 PM Screenshot 2023-11-09 at 2 38 40 PM
cwomack commented 1 year ago

Can you share what you see for the server side call for Auth.currentSession() or possibly log the result? Trying to see what is in the session after that redirect from Google.

rush86999 commented 1 year ago

I'm having a hard time getting console logs but referrer I'm getting: /?state=lQwZcED9nd20vhJlnSWeMpLijoOnXsHz&error_description=RedirectUri%20is%20not%20registered%20with%20the%20client%20&error=invalid_request .

rush86999 commented 1 year ago

but I have: https://xxxx-prod.auth.us-east-1.amazoncognito.com/oauth2/idpresponse as redirect uri for the google client id

rush86999 commented 1 year ago

vercel is giving me a tough time getting server logs, nothing is coming out

rush86999 commented 12 months ago

hey @cwomack, just making sure you saw my notes. vercel is not loggin anything despite me using console.log everywhere but it may be due to redirect uri as I mentioned in my previous thread.

cwomack commented 11 months ago

@rush86999, can you try calling Auth.currentAuthenticatedUser() client side to validate that you are getting logged in properly, and we can isolate the problem to the SSR side of things (rather than issues with the federated sign in)?

cwomack commented 11 months ago

Also want to add that v6 of Amplify was just released last week with improvements in many areas, including SSR and Next.js support. If you're able to, I'd highly recommend upgrading to the latest version. Regardless, want to help you figure this out on v5 if we can!

rush86999 commented 11 months ago

Here are the few errors. I just realized console logs were removed in production :)

{
    "dt": "1700703811152",
    "message": "START RequestId: 6adc4483-68c4-4ca3-b216-104de0fd3139 Version: $LATEST\n2023-11-23T01:43:31.193Z\t6adc4483-68c4-4ca3-b216-104de0fd3139\tINFO\tinside session\n2023-11-23T01:43:31.193Z\t6adc4483-68c4-4ca3-b216-104de0fd3139\tINFO\tNo current user  unable to get logged in user sub\nEND RequestId: 6adc4483-68c4-4ca3-b216-104de0fd3139\nREPORT RequestId: 6adc4483-68c4-4ca3-b216-104de0fd3139\tDuration: 59.02 ms\tBilled Duration: 60 ms\tMemory Size: 1024 MB\tMax Memory Used: 351 MB\t\n",
    "platform": "Vercel",
    "vercel": {
        "branch": "main",
        "deployment_id": "dpl_4CTFGVriE33rCjDjdAeSiPgdC2iT",
        "environment": "production",
        "host": "atomic-mizsedztu-rush86999-s-team.vercel.app",
        "id": "1700703811158283351012346449",
        "path": "/",
        "projectName": "atomic-app",
        "project_id": "prj_S3MDTeMuduu1PYm6HZ3VuoIjLMst",
        "proxy": {
            "client_ip": "216.174.66.37",
            "host": "app.atomiclife.app",
            "lambdaRegion": "iad1",
            "method": "GET",
            "path": "/?state=5zqHO395sirgyrAryOzxHKxkVlvul5sY&error_description=RedirectUri%20is%20not%20registered%20with%20the%20client%20&error=invalid_request",
            "pathType": "FUNC",
            "referer": "https://accounts.google.com/",
            "region": "cle1",
            "scheme": "https",
            "status_code": 307,
            "timestamp": 1700703811152,
            "user_agent": [
                "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
            ],
            "vercelCache": "MISS",
            "vercelId": "xpfmk-1700703811152-01523706577f"
        },
        "request_id": "cle1::iad1::xpfmk-1700703811152-01523706577f",
        "source": "lambda",
        "source_type": "http",
        "statusCode": 307
    }
}

also server side edge functions

Error: No current user
rush86999 commented 11 months ago

how do i upgrade my app to v6?

rush86999 commented 11 months ago

just to add Auth.currentAuthenticatedUser() on client side can only be called inside user login component as the user gets redirected from other paths to login

rush86999 commented 11 months ago

Let me know if you need any other code to verify for the app to help with the diagnoses. I can also take a screenshot with blurred url to show I have cognito for the given client id just to show I followed instructions. Maybe I'm missing something else, I have no idea at this point.

nadetastic commented 8 months ago

HI @rush86999 following up here - I took a quick look at the app link you shared at this comment above and tested this out myself and an error that stood out to me was RedirectUri is not registered with the client

errormessage

What this potentially means is that the redirect uri (redirect_uri: https://app.atomiclife.app//) that is being used here is not whitelisted in the Cognito UserPool client. Although I do see that you have it defined in your aws-exports that you shared above, can you confirm that it is also present in Cognito?

You can check by going to Cognito console then:

  1. Go to you userpool
  2. Select the App Integration tab
  3. Scroll down and select the approriate app client
  4. In the Hosted UI section there should be a list of Allowed callback URLs where this url should be
cwomack commented 7 months ago

@rush86999, wanted to check in again to see if you're still blocked by this or saw @nadetastic's comment above. Let us know if there's still help needed here!

rush86999 commented 7 months ago

I basically stopped working on this project. Sorry guys.

On Thursday, Mar 28, 2024, 7:55 PM, wrote:

@rush86999, wanted to check in again to see if you're still blocked by this or saw @nadetastic's comment above. Let us know if there's still help needed here! You are receiving this because you were mentioned.Message ID:

cwomack commented 6 months ago

@rush86999, I'll close this issue based on the last comment, but feel free to comment back anytime if you get back to this project and still experience the issue.