how this reload method works and what exactly it is used for? - firebase

I am working on a hybrid application using ionic 3 and Angular 4.
My problem is
when user gets registered on the app by email and password he is getting a verification link on that email, after he clicks on the verification link, i want the page gets refreshed and user will be redirected to the home screen. I searched about it then i got this reload method but there is no description about this method.
firebase.auth().currentUser.reload()
Please Help

Related

Clicking on the email verification link gives a page that says 'Unauthorized'

I am facing an issue with my app which used to work perfectly.
I am using email authentication and verification in my app. The verification link gets sent perfectly but the issue is when I click the verification link. I get a blank white page with the word 'Unauthorized'.
you can see it here.
After some testing, I found out that this error only happens on emails that end with kfupm.edu.sa ( which is the only domain I programmed my app to accept).
Is there anything I could do to solve this issue?

URL from Firebase Dynamic Links generates a "Suspicious Link" warning

So, I have a web application where users can register and when they do, a confirmation email is sent to their inbox to confirm their email. This email that is sent contains a link that takes you to the log in page, and we use firebase to convert that link into a short dynamic link, example: https://xm5z5.app.goo.gl/wiRt.
However, when this link is clicked, the user gets a "suspicious link" warning from google and I can't seem to understand why this happens. I've read that a few other people with web apps have the same issue with google flagging one of their links as suspicious. Why could this be and how can this be solved?

Specflow test on login

I have a Specflow/Gherkin test to test an Asp.net application that involves logging into to perform an action using Selenium (and FireFox). Above my controller action I have the [Authorize] token and the site performs as I expect when manually testing. My login uses Forms Authentication.
My test goes as follows:
Navigate to Login page
Provide user and password
Click Login
Navigate to Create Product page (must be logged in)
Enter product detail
Save button
Check item is in database
What looks to be happening is steps 1-3 are fine. But when I execute Step 4, it is redirecting to the login page again. So Step 5 fails, as that isn't the page that is expected.
If I Start at Step 3 and login on the redirect, it works fine e.g.:
Navigate to Create Product page
Provide user and password
Click Login
Enter product detail
Save button
Check item is in database
Is there something specific I need to add to Selenium to make it save the session/login token?
When we're writing a BDD test either with Specflow, Cucumber or any other tool, we need to center our focus on what the end user needs to do to get the scenario done, in other words: the "As a user" perspective.
So in your scenario, as a user if he needs to navigate to loginPage, login and then navigate to createProductPage and login again, so be it! If that's true, write steps that would login again.
If not, on the other hand, if the user needs to login one single time, you don't need to store a session or anything else, I think in this case you have a bug in your application.
PS: if that wont work you can store a profile of your browser with the authentication token and use it, because when a browser gets instantiated it gets a clean browser profile.
OK so it transpires that the transition between steps 3 and 4 are happening too quick. So once I Login, i should verify the page title for example (as it redirects back to the Home page) and then proceed to the Create. Step 4 happens too quick to save the cookie/session.

How to delete Iron Router history

I am using Iron router for meteor and want to create android mobile apps. I create login page that look like WhatsApp application. After user successfully login, i want to make sure that when user click back button,user will never go back to that page. Home page after login is the last page user will view if he keep click back button. So if user click two times back button in the homepage, the application will close.
I hope anyone understand my problem.
My problem is, the first time after user register, the android functionality to kill application after two times back click will not occur.Or can i replicate the two times back button function so if i am in my homepage(after login), and i click button two times, the application will close?
Iron:router has the option {replaceState: true} that you can use.
To accomplish this, all that you need to do is to change your Router.go('home') to Router.go('home', {}, {replaceState: true}) in your redirect hook after login.
With this when your use presses the back button, home will have replaced your login route in the history, and the user will not go to the login page.
EDIT: I just realised that's not exactly what you asked for, but it could help you somehow anyway. I'll try to replicate your case and will edit this post if I find a solution for your issue with exiting the application.
You could accomplish that by setting login page to be displayed only if user is not logged in.
Depends on your app structure you can use {{currentUser}} in html or Meteor.userId() in JS. One solution (the easy way) would be evaluating Meteor.userId() (true if user logged in) on login page route. If it turns out that user is already logged in, it redirects to home page for example.

How can I stop user from navigating to the previous page

I am developing a simple email portal as my college assignment and I refer gmail for various features.Now when we sign into a gmail account and then if we hit the back button of the browser we somehow still remain on the inbox page.In my case after login if I press back button I comeback to the login page.Please suggest how can I achieve this.Also I am a newbie to ASP.NET so keep it detailed
Very simple. When loading the login page, check the user's current session state, and if they're already logged in, redirect them to their inbox.
The trick is to use javascript's "history.replace(...)" function:
http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript
In essence, you remove previous history entries.

Resources